pvar {plm}R Documentation

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 see plm.data,
... further arguments.

Details

pvar is called by plm, except if pvar=FALSE. It is used to omit time–invariant variables from the estimation. It is therefore useful for whithin models, but also for random effect models estimated by the Swamy and Arora method (which uses the results of the within model). It can be time consuming for ``big'' panels.

Value

an object of class pvar containing the following elements :

id.var a logical vector with TRUE values if the variable has individual variation, FALSE otherwise,
time.var a logical vector with TRUE values if the variable has time variation, FALSE otherwise,

Author(s)

Yves Croissant

See Also

plm

Examples


#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")


[Package plm version 1.1-1 Index]