R package primarily concerned with panel data. Package contains a set of estimators and tests for panel data.
Questions tagged [plm]
510 questions
1
vote
0 answers
How can I use predict to a plm regression model?
I have the following panel regression:
reg.soja.4 <- plm(Soja_Produtividade ~
jan_temp_dev + fev_temp_dev + mar_temp_dev + abr_temp_dev +
mai_temp_dev + jun_temp_dev + jul_temp_dev + ago_temp_dev +
…

gabieljaick
- 13
- 3
1
vote
1 answer
including non linearity in fixed effects model in plm
I am trying to build a fixed effects regression with the plm package in R. I am using country level panel data with year and country fixed effects.
My problem concerns 2 explanatory variables. One is an interaction term of two varibels and one is a…

user17497170
- 11
- 1
1
vote
2 answers
How to get within R squared from plm FE regression?
I regress monthly stocks returns on a set of firm characteristics using the plm package.
library(plm)
set.seed(1)
id=rep(1:10,each=10); t=rep(1:10,10); industry=rep(1:2,each=50); return=rnorm(100);…

Victor
- 11
- 2
1
vote
0 answers
Balancing panel containing dates with R
The use of dates in plm prevents it from balancing the panel with the make.pbalanced function:
State <- c("alabama", "alabama", "alabama", "alabama",
"california", "california", "maine", "kansas")
Date <- c("2021-01-25", "2021-01-26",…

Jb_Eyd
- 635
- 1
- 7
- 20
1
vote
0 answers
Issue with pFtest from plm package returning p-value = NA
I'm having a problem with with the pFtest() function from the plm package.
I'm using the following three tests (see code below). However, if you look at the output you will see that for the pFtest I get a p-value = NA. I guess this is due to the…

Aschi
- 11
- 2
1
vote
0 answers
How to add dummy interactions using pgmm
I am trying to add a dummy variable in order to determine the coefficients for a specific factor (MUNICIPIO) usin pgmm() in R.
This is the code:
GN_Municipal_Empresa <- pgmm(log(CANTIDAD_M3+1) ~…

Miguel Gutierrez
- 159
- 2
- 8
1
vote
1 answer
Correlation in panel data with plm package in R
My question was: I'm trying to calculate the correlation between "ftd" and "ici"
variables but I can't figure out how to use cortab function and I
couldn't find any example in web about that.
To those who want to learn how to use cortab function,…

onur
- 13
- 3
1
vote
0 answers
Plm function changes balanced panel to unbalanced
I have a problem with my panel data regression. The dataset shows a balanced panel consisting of n= 10, T = 26, N= 260. However, once I start my regression I get an unbalanced panel and the n declines to 7. I am assuming that it is because I do have…

Mimi
- 11
- 3
1
vote
1 answer
Margins for PLM Models
I understand that this question was asked multiple times, but none received a satisfying answer.
I am quite new to using R (transitioning from Stata) and I would like to know whether marginal effect calculation is possible for plm model?
If not, how…

rooftopprofessor
- 11
- 1
1
vote
0 answers
Two-way fixed effects panel regression by group
I have searched a lot of question as to how I can successfully do this but to no avail. The closest I have come is this: Panel regression by group , but even that does not completely cover the scope of what I want.
I have a dataset containing…
user12973342
1
vote
0 answers
Two fixed effects variables and one random effect? plm in r
I believe I have found a way of having three variables (ID, Time and type) as fixed effect using the plm function (where I have previously indexed the ("ID","Time") in pdata.frame):
FixedEffects <- plm(Y ~ x1 + X2 + factor(type),
…

Lucas Gomes
- 11
- 1
1
vote
0 answers
Problems with panel regression in R
I am trying to do a panel regression with the plm-function (Package ‘plm’) in R. But apparently there's something wrong with my data structure.
This is my model:
fixedeff <- plm(iwyg~edyear*secondos,
data = cohort_long_gesamt_panel,
…

Ezgi
- 11
- 1
1
vote
1 answer
unit root test for unbalanced panel data
I want to conduct unit root test for my unbalanced multi-variate panel data.
I use only R studio. I saw many helpful posts on Stata and EViews but I am seeking solutions for RStudio only, please.
I searched on the internet how to conduct the test…

NK70
- 11
- 2
1
vote
1 answer
Cluster bootstrapped standard errors in R for plm functions
I have a fixed effects model with only few observations and would therefore like to bootstrap in order to obtain more accurate standard errors. At the same time, I assume SE to be clustered thus I would also like to correct for clustering, i.e. do a…

Laura
- 31
- 2
1
vote
0 answers
R - Fixed-effects regression "plm" vs "lm + as.factor()": interpretation of R and R-Squared
I understand from this question here that coefficients are the same whether we use a lm regression with as.factor() and a plm regression with fixed effects.
N <- 10000
df <- data.frame(a = rnorm(N), b = rnorm(N),
region = rep(1:100,…

Mat36
- 33
- 4