plm (version 1.6-5)

pdim: Check for the Dimensions of the Panel

Description

This function checks the number of individuals and time observations in the panel and whether it is balanced or not.

Usage

pdim(x, ...) "pdim"(x, index = NULL, ...) "pdim"(x, ...) "pdim"(x, ...) "pdim"(x, ...) "pdim"(x, ...)

Arguments

x
a data.frame, a pdata.frame, a pseries, a panelmodel, or a pgmm object,
index
...
further arguments.

Value

An object of class pdim containing the following elements:

Details

pdim is called by the estimation functions and can be also used stand-alone.

See Also

is.pbalanced to just determine balancedness of data (slightly faster than pdim), punbalancedness for measures of unbalancedness, nobs, pdata.frame, pvar to check for each variable if it varies cross-sectionally and over time.

Examples

Run this code
# There are 595 individuals
data("Wages", package = "plm")
pdim(Wages, 595)

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

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

# An example of the panelmodel method
data("Produc", package = "plm")
z <- plm(log(gsp)~log(pcap)+log(pc)+log(emp)+unemp,data=Produc,
         model="random", subset = gsp > 5000)
pdim(z)

Run the code above in your browser using DataLab