## Panel Data Econometrics in R: The plm Package (2008)

### Cached

### Download Links

Venue: | Journal of Statistical Software |

Citations: | 15 - 1 self |

### BibTeX

@ARTICLE{Croissant08paneldata,

author = {Yves Croissant and Université Lumière Lyon and Giovanni Millo},

title = {Panel Data Econometrics in R: The plm Package},

journal = {Journal of Statistical Software},

year = {2008}

}

### OpenURL

### Abstract

This introduction to the plm package is a slightly modified version of Croissant and Millo (2008), published in the Journal of Statistical Software. Panel data econometrics is obviously one of the main fields in the profession, but most of the models used are difficult to estimate with R. plm is a package for R which intends to make the estimation of linear panel models straightforward. plm provides functions to estimate a wide variety of models and to make (robust) inference. Keywords:˜panel data, covariance matrix estimators, generalized method of moments, R. 1.

### Citations

2078 |
Some tests of specification for panel data: Monte Carlo evidence and an application to employment equation, The Review of Economic Studies
- Arellano, Bond
- 1991
(Show Context)
Citation Context ...um of Squares: 2194300 Multiple R-Squared: 0.99537 5.4. Generalized method of moments estimator The generalized method of moments is mainly used in panel data econometrics to estimate dynamic models (=-=Arellano and Bond 1991-=-; Holtz-Eakin, Newey, and Rosen 1988). yit = ρyit−1 + β ⊤ xit + µi + ɛit (10) The model is first differenced to get rid of the individual effect: ∆yit = ρ∆yit−1 + β ⊤ ∆xit + ∆ɛit (11) Least squares ar... |

2027 |
Econometric Analysis
- Greene
- 1990
(Show Context)
Citation Context ...downwards. In a pooled time series context (effect="time"), symmetrically, this estimator is able to account for arbitrary cross-sectional correlation, provided that the latter is time-invariant (see =-=Greene 2003-=-, 13.9.1–2, p.321–2). In this case serial correlation has to be assumed away and the estimator is consistent with respect to the time dimension, keeping n fixed. The function pggls estimates general f... |

1761 | A heteroskedasticity-consistent covariance matrix and a direct test for heteroskedasticity - White - 1980 |

1171 | Initial Conditions and Moment Restrictions in Dynamic Panel Data Models - Blundell, Bond - 1998 |

897 |
Econometric Analysis of Panel Data
- Baltagi
- 2001
(Show Context)
Citation Context ... implemented, ˆ the only estimator of the variance of the error components is the one proposed by Swamy and Arora (1972) The following example is using data used by (?) function. It is reproduced in (=-=Baltagi 2001-=-), p. 174. to estimate an hedonic housing prices R> data("Hedonic", package = "plm") R> Hed <- plm(mv ~ crim + zn + indus + chas + nox + rm + age + dis + + rad + tax + ptratio + blacks + lstat, Hedoni... |

718 |
Specification tests in econometrics
- Hausman
- 1978
(Show Context)
Citation Context ...ificant effects R> pFtest(inv ~ value + capital, data = Grunfeld, effect = "twoways") 6.3. Hausman test phtest computes the Hausman test which is based on the comparison of two sets of estimates (see =-=Hausman 1978-=-). Its main arguments are two panelmodel objects or a formula. A classical application of the Hausman test for panel data is to compare the fixed and the random effects models: R> gw <- plm(inv ~ valu... |

463 | Core Team. 2008. R: A language and environment for statistical computing. R foundation for statistical computing - Development |

396 | Random effects models for longitudinal data. Biometrics 38:963–974 - Laird, Ware - 1982 |

326 | Estimating Vector Autoregressions with Panel Data - Holtz-Eakin, Newey, et al. - 1988 |

290 |
Estimation of Dynamic Models with Error Components
- Anderson, Hsiao
(Show Context)
Citation Context ...ifferenced to get rid of the individual effect: ∆yit = ρ∆yit−1 + β ⊤ ∆xit + ∆ɛit (11) Least squares are inconsistent because ∆ɛit is correlated with ∆yit−1. yit−2 is a valid, but weak instrument (see =-=Anderson and Hsiao 1981-=-). The gmm estimator uses the fact that the number of valid instruments is growing with t: ˆ t = 3: y1, ˆ t = 4: y1, y2, ˆ t = 5: y1, y2, y3 For individual i, the matrix of instruments is then:22 Pan... |

265 |
lme4: Linear mixed-effects models using S4 classes. R package version
- Bates
- 2007
(Show Context)
Citation Context ... framework for (among many other features) maximum likelihood estimation of linear regression models for longitudinal data, packages nlme (Pinheiro, Bates, DebRoy, and the˜R Core˜team 2007) and lme4 (=-=Bates 2007-=-), is available in the R (R Development Core Team 2008) environment and can be used, e.g., for estimation of random effects panel models, its use is not intuitive for a practicing econometrician, and ... |

228 | A finite sample correction for the variance of linear efficient two-step GMM estimators - Windmeijer - 2005 |

195 |
Econometric Analysis, 5th edition
- Greene
(Show Context)
Citation Context ...downwards. In a pooled time series context (effect="time"), symmetrically, this estimator is able to account for arbitrary cross-sectional correlation, provided that the latter is time-invariant (see =-=Greene 2003-=-, 13.9.1–2, p.321–2). In this case serial correlation has to be assumed away and the estimator is consistent with respect to the time dimension, keeping n fixed. The function pggls estimates general f... |

193 | Asymptotic Theory for Econometricians - White - 2001 |

154 |
Econometric Analysis of Cross-Section and Panel Data
- Wooldridge
- 2002
(Show Context)
Citation Context ...e general24 Panel Data Econometrics in R: The plm Package than the random effects one for use in a feasible-gls analysis. Formally, the estimated error covariance matrix is ˆ V = In ⊗ ˆ Ω, with (see =-=Wooldridge 2002-=-, 10.4.3 and 10.5.5). ˆΩ = n∑ i=1 ûitû ⊤ it n This framework allows the error covariance structure inside every group (if effect="individual") of observations to be fully unrestricted and is therefore... |

113 |
Computing Robust Standard Errors for Within-Groups Estimators”Oxford Bulletin of Economics and Statistics
- Arellano
- 1987
(Show Context)
Citation Context ...ommon variance inside every group, estimated as σ2 i = ∑T t=1 û2 it /T , so that Ωi = IT ⊗ σ2 i (see Greene (2003, 13.7.1–2) and Wooldridge (2002, 10.7.2); "arellano" (see ibid. and the original ref. =-=Arellano 1987-=-) allows a fully general structure w.r.t. heteroskedasticity and serial correlation: ⎡ σ Ωi = ⎢ ⎣ 2 i1 σi1,i2 . . . . . . σi1,iT σi2,i1 σ2 i2 . . . .. . . σ2 iT −1 σiT −1,iT σiT,i1 . . . . . . σiT,iT ... |

102 | General diagnostic tests for cross section dependence in panels. (IZA Discussion Paper No. 1240 and CESifo Working Paper No
- Pesaran
- 2004
(Show Context)
Citation Context ...on is “large”. A scaled version, applicable also if T → ∞ and then n → ∞ (as in some pooled time series contexts), is defined as √ 1 SCLM = n(n − 1) ( and distributed as a standard Normal. Pesaran’s (=-=Pesaran 2004-=-) CD test √ 2 CD = n(n − 1) ( n−1 ∑ n∑ i=1 j=i+1 n−1 ∑ n∑ i=1 j=i+1 √ Tij ˆρ 2 ij) √ Tij ˆρij) based on ρij without squaring (also distributed as a standard Normal) is appropriate both in n– and in T ... |

98 |
Efficient Inference in a Random Coefficient Regression Model
- Swamy
- 1970
(Show Context)
Citation Context ...are assumed to be fixed if model="within" or random if model="random". In the first case, a different model is estimated for each individual (or time period). In the second case, the Swamy model (see =-=Swamy 1970-=-) model is estimated. It is a generalized least squares model which uses the results of the previous model. Denoting ˆ βi the vectors of coefficients obtained for each individual, we get: ˆβ = ( n∑ i=... |

84 |
On the Pooling of Time-Series and
- Mundlak
- 1978
(Show Context)
Citation Context ...nometrics is often recognized to be misleading, as both are treated as random variates in modern econometrics (see e.g. Wooldridge 2002, 10.2.1). It has been recognized since Mundlak’s classic paper (=-=Mundlak 1978-=-) that the fundamental issue is whether the unobserved effects are correlated with the regressors or not. In this last case, they can safely be left in the error term, and the serial correlation they ... |

63 |
An R and S-Plus companion to applied regression
- Fox
(Show Context)
Citation Context ...concile the two terminologies, in the following we report the specification of the panel models in plm according to the general expression of a mixed model in Laird-Ware form (see the web appendix to =-=Fox 2002-=-) and the nlme estimation commands for maximum likelihood 23 For fixed effects estimation, as the sample grows (on the dimension on which the fixed effects are specified) so does the number of paramet... |

57 |
Econometric Analysis of Panel Data. 3rd eds
- Baltagi
- 2005
(Show Context)
Citation Context ... implemented, ˆ the only estimator of the variance of the error components is the one proposed by Swamy and Arora (1972) The following example is using data used by (?) function. It is reproduced in (=-=Baltagi 2001-=-), p. 174. to estimate an hedonic housing prices R> data("Hedonic", package = "plm") R> Hed <- plm(mv ~ crim + zn + indus + chas + nox + rm + age + dis + + rad + tax + ptratio + blacks + lstat, Hedoni... |

57 | Further Evidence on the Estimation of Dynamic Economic Relations from a Time Series of Cross Sections - Nerlove - 1971 |

57 |
On the Pooling of Time Series and Cross Section Data," Econometrica 46
- Mundlak
- 1978
(Show Context)
Citation Context ...nometrics is often recognized to be misleading, as both are treated as random variates in modern econometrics (see e.g. Wooldridge 2002, 10.2.1). It has been recognized since Mundlak’s classic paper (=-=Mundlak 1978-=-) that the fundamental issue is whether the unobserved effects are correlated with the regressors or not. In this last case, they can safely be left in the error term, and the serial correlation they ... |

53 | Testing for Serial Correlation in Linear Panel-Data Models - Drukker - 2003 |

32 | Simultaneous Equations with Error Components - BALTAGI - 1981 |

29 |
Heteroskedasticity-robust Standard Errors for Fixed Effects Panel Data Regressions
- Stock, Watson
- 2006
(Show Context)
Citation Context ...g induces serial correlation in the errors. The original White estimator (white1) turns out to be inconsistent for fixed T as n grows, so in this case it is advisable to use the arellano version (see =-=Stock and Watson 2006-=-). The errors may be weighted according to the schemes proposed by MacKinnon and White (1985) and Cribari-Neto (2004) to improve small-sample performance 18 . The main use of vcovHC is together with t... |

27 | Serial correlation and fixed effects model, Review of Economic Studies - Bhargava, L, et al. - 1982 |

24 |
Testing AR(1) against MA(1) disturbances in error component model
- Baltagi, Li
- 1995
(Show Context)
Citation Context ...r method="arellano") 12 . 11 Baltagi and Li derive a basically analogous T-asymptotic test for first-order serial correlation in a fe panel model as a Breusch-Godfrey LM test on within residuals (see =-=Baltagi and Li 1995-=-, par. 2.3 and formula 12). They also observe that the test on within residuals can be used for testing on the re model, as “the within transformation [time-demeaning, in our terminology] wipes out th... |

21 | The Estimation of Variances in a Variance-Components Model - Amemiya - 1971 |

21 |
spdep: Spatial Dependence: Weighting Schemes, Statistics and Models. R package version
- Bivand
- 2008
(Show Context)
Citation Context ...oups while allowing for heteroskedasticity across groups, so that the full covariance matrix of errors is V = In ⊗ Ωi; i = 16 The very comprehensive package spdep for spatial dependence analysis (see =-=Bivand 2008-=-) contains features for creating, lagging and manipulating neighbour list objects of class nb, that can be readily converted to and from proximity matrices by means of the nb2mat function. Higher orde... |

17 | Full-information estimations of a system of simultaneous equations with error component structure”, Econometric Theory - Balestra, Varadharajan-Krishnakumar - 1987 |

17 |
car: Companion to Applied Regression. R package version 1.2-5, URL http: //CRAN.R-project.org/,http://socserv.socsci.mcmaster.ca/jfox
- Fox
- 2007
(Show Context)
Citation Context ... performance. Robust estimators with any combination of covariance structures and weighting schemes can be passed on to the testing functions. 4See packages lmtest (Zeileis and Hothorn 2002) and car (=-=Fox 2007-=-). 5Moreover, coeftest() provides a compact way of looking at coefficient estimates and significance diagnostics. 8 Panel Data Econometrics in R: The plm Package 4. Managing data and formulae The pack... |

13 |
Matrix: A Matrix package for R. R package version
- Bates, Maechler
- 2006
(Show Context)
Citation Context ...etc.) are assigned the relevant class and the additional information on structure is used in the computations, sometimes with dramatic effects on performance (see Bates 2004) and packages Matrix (see =-=Bates and Maechler 2007-=-) and SparseM (see Koenker and Ng 2007). Some optimized linear algebra routines are available in the R package bdsmatrix (see Atkinson and Therneau 2007) which exploit the particular block-diagonal an... |

12 | Zeileis A (2008). Applied Econometrics with R - Kleiber |

11 | Efficient Estimation with Panel Data: an Empirical Comparison of Instrumental Variables Estimators - Cornwell, Rupert |

10 | The Exact Finite Sample - Swamy, Arora - 1972 |

9 | Asymptotic Inference Under Heteroskedasticity of Unknown Form - Cribari-Neto - 2004 |

9 |
sparsem: Sparse Linear Algebra. R package version 0.74, URL http://CRAN.R-project.org
- Koenker, Ng
- 2007
(Show Context)
Citation Context ...the additional information on structure is used in the computations, sometimes with dramatic effects on performance (see Bates 2004) and packages Matrix (see Bates and Maechler 2007) and SparseM (see =-=Koenker and Ng 2007-=-). Some optimized linear algebra routines are available in the R package bdsmatrix (see Atkinson and Therneau 2007) which exploit the particular block-diagonal and symmetric structure of V̂ making it ... |

8 | Testing the error component model with non-normal disturbances - Honda - 1985 |

7 | Tests for the Error Component Model in the Presence of Local Misspecification - Bera, Sosa-Escudero, et al. - 2001 |

6 | Locally Optimal One–Sided Tests for Multiparameter Hypothese - King, Wu - 1997 |

5 | Monfort A - Gourieroux, Holly - 1982 |

5 | Why Has Productivity Growth Declined - Munnell - 1990 |

4 | Sarafidis V (2006). “Testing for Cross–Sectional Dependence in Panel–Data Models - De˜Hoyos |

1 | Therneau T (2007). kinship: Mixed–Effects Cox Models, Sparse Matrices, and Modeling Data from Large Pedigrees. R package version 1.1.0-18, URL http: //CRAN.R-project.org - Atkinson |

1 | A Joint Test for Serial Correlation - Baltagi, Li - 1991 |

1 | DebRoy S, the˜R Core˜team DS (2007). nlme: Linear and Nonlinear Mixed Effects Models. R package version 3.1-86, URL http://CRAN.R-project.org - Pinheiro, Bates |

1 | Millo 49 Blundell R, Bond S - Croissant, Giovanni - 1998 |