Learn R Programming

plm (version 0.3-1)

pvar: Check Whether Variables of a Panel Have Individual and Time Variations

Description

This function checks for each variable of a panel if it has an individual and a time variation.

Usage

pvar(x, ...)
## S3 method for class 'data.frame':
pvar(x, indexes = NULL, ...)

Arguments

x
a data.frame,
indexes
...
further arguments.

Value

  • an object of class pvar containing the following elements :
  • id.vara logical vector with TRUE values if the variable has individual variation, FALSE otherwise,
  • time.vara logical vector with TRUE values if the variable has time variation, FALSE otherwise,

Details

pvar is called by plm, except if pvar=FALSE. It is used to omit from the estimation of the within variables which don't have any time variation. It is therefore usefull for whithin models, but also for random effect models estimated by the Swamy and Arrora method which use the results of the within model. It can be time consuming for ``big'' panels.

See Also

plm

Examples

Run this code
#There are 595 individuals

data("Wages",package="Ecdat")
pvar(Wages,595)

# Gasoline contains two variables which are individual and time indexes
# and are the first two variables
data("Gasoline",package="Ecdat")
pvar(Gasoline)

# Hedonic is an unbalanced panel, townid is the individual index
data("Hedonic",package="Ecdat")
pvar(Hedonic,"townid")

Run the code above in your browser using DataLab