Questions tagged [plm]
R package primarily concerned with panel data. Package contains a set of estimators and tests for panel data.
526
questions
0
votes
0
answers
14
views
How to get KP F-stat in IV regression in R? [migrated]
I am running an IV regression with fixed effects and clustered standard errors similar to the one below and would like to compute the Kleibergen-Paap (rank) F-statistic for weak identification. Is ...
0
votes
0
answers
5
views
Tobit estimation on panel data in combination with an IV approach in r? [migrated]
I have panel data (country by year) and my dependent variable is left-censored (many countries have zero values, other countries have very large numbers). So, I think that I should implement a Tobit ...
0
votes
0
answers
55
views
Value-added Plots for models estimated by plm-package in r and interpretation?
If I estimated my model using the lm-function, I would be able to create Value-Added Plots typing the following code:
ols_model <- lm( log(y) ~ log(x1) + log(x2) + log(x3), data = data)
avPlots(...
0
votes
1
answer
76
views
Clustered/Robust standard errors in R
I am estimating an OLS regression without fixed effects and an OLS regression with fixed effects in R Studio. I have read, that it is common to use robust standard errors, when estimating a simple OLS ...
0
votes
1
answer
113
views
HAC standard errors in r using plm package?
I want to estimate a fixed effects model (with both country- and year fixed effects) and ADDITIONALLY apply HAC standard errors. Although I didn't get any error message after running the following ...
0
votes
0
answers
18
views
HAC standard errors in r with panel data? [duplicate]
I want to estimate a fixed effects model (with both country- and year fixed effects) and ADDITIONALLY apply HAC standard errors. Although I didn't get any error message after running the following ...
0
votes
0
answers
34
views
Fixed Effects Panel Data Models with Multiply Imputed Data
I used the mice package to create 5 implicates of a dataset. I am interested in using fixest:feols() to estimate a fixed effects model that looks like this
m1 <- with(mi_data,
...
1
vote
1
answer
42
views
Two-way fixed effect estimation via `plm` fails with an error message (but works via `lm`)
I am trying to run a two-way fixed-effects panel regression using plm in R. First, I randomly generate some data. Then I create time and firm indices (two-way indexing as usual in a panel dataset) and ...
1
vote
2
answers
140
views
Bootstrap panel data: randomly selecting individuals, not the person-waves
I am trying to replicate the Stata code (available here) in R. The idea is randomly selecting bootstrap sample from the idcode, not the
idcode-year and then estimate
the parameters from the selected ...
0
votes
0
answers
54
views
"Error in checkNA.index(index) : NA in the individual index variable" when using a bootstrapped dataset as input for the plm function in R
I wanted to use a bootstrapped sample as input for my plm function, but seem to be getting the error "Error in checkNA.index(index) : NA in the individual index variable".
Specifically, I ...
1
vote
1
answer
52
views
PLM package: Difference between PMG and PCCE function
What is the difference of pmg and pcce function in package plm? Details of both is almost same in the description. I wanted to perform mg, pmg and CCE mg test on panel data using plm function. I ...
1
vote
1
answer
46
views
Fixed-effects regressions with Amelia object
I have time-series cross-sectional data with missing data. I have imputed the data with Amelia, but I encounter two error when I try to run my fixed effect regressions. First, if I do not specify the ...
0
votes
1
answer
51
views
Add overall intercept to stargazer table in R in panel data analysis fixed effects model
I wish to add the overall intercept of a fixed effects model ("within" panel data analysis). This is common practice in Stata and I wish to mimic the Stata output by including the overall ...
0
votes
2
answers
80
views
Creating T-1 variable | R [duplicate]
I would like to create a new variable sales.T.minus.1 which will present the value of sales from year - 1. I created a replicable example below:
library(plm)
library(dplyr)
data <- pdata....
0
votes
0
answers
86
views
How to do interrupted time series analysis using R's plm?
I am trying to model the following interrupted time series model:
y = b0 + b1*time + b2*event + b3*time_since_event
The data, however, is nested inside users (id). Currently, I have the following ...