MyNixOS website logo
Description

Linear Models for Panel Data.

A set of estimators for models and (robust) covariance matrices, and tests for panel data econometrics, including within/fixed effects, random effects, between, first-difference, nested random effects as well as instrumental-variable (IV) and Hausman-Taylor-style models, panel generalized method of moments (GMM) and general FGLS models, mean groups (MG), demeaned MG, and common correlated effects (CCEMG) and pooled (CCEP) estimators with common factors, variable coefficients and limited dependent variables models. Test functions include model specification, serial correlation, cross-sectional dependence, panel unit root and panel Granger (non-)causality. Typical references are general econometrics text books such as Baltagi (2021), Econometric Analysis of Panel Data (<doi:10.1007/978-3-030-53953-5>), Hsiao (2014), Analysis of Panel Data (<doi:10.1017/CBO9781139839327>), and Croissant and Millo (2018), Panel Data Econometrics with R (<doi:10.1002/9781119504641>).

The plm Package - Linear Models and Tests for Panel Data

CRAN status Downloads

About

plm is a package for panel data econometrics for the R statistical computing environment. The package includes functions for model estimation, testing, robust covariance matrix estimation, panel data manipulation and information. It was first published on CRAN in 2006.

Be sure to read the NEWS on CRAN for any changes in new releases (new features, bugfixes, other improvements, ...).

Non-exhaustive function overview:

  • Functions to estimate models:

    • plm: panel data estimators (within/fixed effects, random effects, between, first-difference, nested random effects), incl. instrumental-variable estimation techniques (IV) and Hausman-Taylor-style models,
    • pgmm: generalized method of moments (GMM) estimation for panel data,
    • pggls: estimation of general feasible generalized least squares models,
    • pmg: mean groups (MG), demeaned MG and common correlated effects (CCEMG) estimators,
    • pcce: estimators for common correlated effects mean groups (CCEMG) and pooled (CCEP) for panel data with common factors,
    • pvcm: variable coefficients models,
    • pldv: panel estimators for limited dependent variables.
  • Testing functions:

    • model specification (phtest, pFtest, pooltest, plmtest, pwaldtest, piest, aneweytest, mtest, sargan),
    • serial correlation (pbgtest, pwfdtest, pbnftest, pdwtest, pwartest, pbsytest, pbltest),
    • cross-sectional dependence (pcdtest),
    • panel unit root (purtest, cipstest, phansitest),
    • panel Granger (non-)causality (pgrangertest).
  • Robust covariance matrix estimators (incl. various weighting schemes for small sample adjustment):

    • vcovHC: Arellano (1987), White (1980),
    • vcovBK: Beck and Katz (1995) (PCSE),
    • vcovNW: Newey and West (1987),
    • vcovDC: double-clustering robust (Thompson (2011), Cameron et al. (2011)),
    • vcovSCC: Driscoll and Kraay (1998).
  • An enhanced data frame, called pdata.frame, to deal with data sets for which observations are identified by a combination of two indexes.

  • Panel data transformation functions (e.g., Within, Between, between, lag, lead, diff).

  • Other functions relating to panel data sets, e.g.:

    • checks for panel data dimensions (individual, time, group) and balancedness (pdim),
    • checks for panel balancedness (is.pbalanced) and consecutiveness (regularity) (is.pconsecutive) as well as functions to change data to conform to these properties (make.pbalanced, make.pconsecutive),
    • measures for unbalancedness of data (punbalancedness) (Ahrens/Pincus (1981)).

Installation

To install the released version from CRAN:

install.packages("plm")

The package's CRAN website is https://cran.r-project.org/package=plm.

The development of package plm takes place on GitHub at https://github.com/ycroissant/plm. To install the development version from GitHub, use, e.g.:

# install.packages("remotes") # remove '#' if pkg 'remotes' is not installed
remotes::install_github("ycroissant/plm")

Documentation

Package plm comes with documentation: Besides the usual help pages for each function, the vignettes provide a gentle introduction to the package and some functions. Vignettes are available at the package's CRAN website https://cran.r-project.org/package=plm and can be browsed from within R by browseVignettes("plm").

New package users are advised to start with the first vignette Panel data econometrics in R: the plm package for an overview of the package. A more in-depth treatment of estimation of error component models and instrument variable models is in the second vignette Estimation of error component models with the plm function.

Further, many textbooks treat package plm and/or use it in their examples:

  • Croissant/Millo, Panel Data Econometrics with R, 2019, John Wiley & Sons, Hoboken.

  • Kleiber/Zeileis, Applied Econometrics with R, 2008, Springer, New York. Esp. chapter 3.6.

  • Hanck/Arnold/Gerber/Schmelzer, Econometrics with R, online book https://www.econometrics-with-r.org/. Esp. chapter 10.

  • Heiss, Using R for Introductory Econometrics, 2nd edition, 2020, Independent Publishing, Düsseldorf, also available online at http://www.urfie.net/. A companion book using R to Wooldridge, Introductory Econometrics, esp. chapters 13-14.

Metadata

Version

2.6-4

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows