R package primarily concerned with panel data. Package contains a set of estimators and tests for panel data.
Questions tagged [plm]
510 questions
8
votes
3 answers
Lagging Forward in plm
This is a very simple question, but I haven't been able to find a definitive answer, so I thought I would ask it. I use the plm package for dealing with panel data. I am attempting to use the lag function to lag a variable FORWARD in time (the…

Matt
- 537
- 5
- 19
7
votes
3 answers
R: avoiding summary.plm
I'm using R to run a Monte-Carlo simulation studying the performance of panel data estimators. Because I'll be running a large number of trials, I need to get at least decent performance from my code.
Using Rprof on 10 trials of my simulation shows…

Wilduck
- 13,822
- 10
- 58
- 90
7
votes
1 answer
How to perform piece wise/spline regression for longitudinal temperature series in R (New Update)?
Here I have temperature time series panel data and I intend to run piecewise regression or cubic spline regression for it. So first I quickly looked into piecewise regression concepts and its basic implementation in R in SO, got an initial idea how…

Andy.Jian
- 417
- 3
- 15
7
votes
3 answers
How to compare 2 models in R using the plm package?
So I am running a fixed effects model using the plm package in R, and I am wondering how I can compare which of two models are more suitable.
For example, here is the code for two models I have constructed:
library(plm)
eurofix <- plm(rlogmod ~…

NuclearPenguins
- 83
- 1
- 9
6
votes
3 answers
texreg on panelmodel (plm) object; additional gof information
How do I customize the goodness of fit (gof) in a texreg call?
I have some plm models I want to display, but I only get "Num. obs.", "Adj. R^2", and , "R^2" (see working example below). I would howver like to all display small n, T, F-statistic, and…

Eric Fail
- 8,191
- 8
- 72
- 128
6
votes
0 answers
R2 with plm package
When estimating the pooled model using the plm package using this syntax I get an R2 that is nearly 0.8.
library(plm)
data <- employmentsez
data$lfirms2 <- data$lfirms*data$lfirms
data$sezname <- as.factor(data$sezname)
data <- plm.data(data,…

Camilla Jensen
- 61
- 2
6
votes
1 answer
plm Package in R - empty model when including only variables without variation over time per individual
I have a dataframe ('math') like this (there are three different methods, although only one is shown) -
dataframe
I am trying to create a multi-level growth model for MathScore, where VerbalScore is an independent, time invariant, random effect.
I…

Eric
- 63
- 1
- 1
- 3
5
votes
1 answer
IV Estimation with Cluster Robust Standard Errors using the plm package in R
I'm using the plm package for panel data to do instrumental variable estimation. However, it seems that calculating cluster robust standard errors by using the vcovHC() function is not supported.
More specifically, when I use the vcovHC() function,…

André
- 55
- 4
5
votes
1 answer
How to regress multiple series on single series conditioned on grouping variables?
I feel that my basic problem is how to regress multiple series on a single series. Although my series are not equal in time, even when I use equal time length series for stock and benchmark(I can provide data I made equal manually if needed) I get…

Polar Bear
- 731
- 1
- 7
- 21
5
votes
1 answer
Calculating within, between or overall R-square in R
I'm migrating from Stata to R (plm package) in order to do panel model econometrics. In Stata, panel models such as random effects usually report the within, between and overall R-squared.
I have found that the reported R-squared in the plm Random…

user3507584
- 3,246
- 5
- 42
- 66
5
votes
0 answers
Stargazer error with plm
I obtain an error when using stargazer in conjunction with plm. Everything works fine for ordinary linear models. Here's an example:
library(plm)
library(stargazer)
# create test data
dat <- data.frame(y=runif(1000),
…

Max
- 51
- 3
5
votes
0 answers
System exactly singular with pgmm (package plm)
I am trying to run a pgmm regression (Arellano Bond estimator) following the example online with the EmplUK dataset.
My dataset is unbalanced, with some missing values (that I also removed, without any difference). This is the paste from R'…

Luca Gi
- 159
- 7
5
votes
2 answers
R: Plotting panel model predictions using plm & pglm
I've created two regression models using a linear panel model with plm, and a generalized panel model using poisson with the pglm package.
library(plm); library(pglm)
data(Unions) # from pglm-package
punions <- pdata.frame(Unions, c("id",…

ageil
- 171
- 1
- 3
- 16
5
votes
1 answer
How to calculate dynamic panel models with lfe package
I am trying to estimate a large dynamic fixed effects panel data model with lags, and multiple group effects.
I know about the pseries object from the plm package which can handle panel regression with lags.
library(plm)
data("EmplUK", package =…

kennyB
- 1,963
- 3
- 17
- 22
5
votes
3 answers
Panel data with binary dependent variable in R
Is it possible to do regressions in R using a panel data set with a binary dependent variable? I am familiar with using glm for logit and probit and plm for panel data, but am not sure how to combine the two. Are there any existing code…

Abiel
- 5,251
- 9
- 54
- 74