pvcm: Variable Coefficients Models for Panel Data

View source: R/est_vcm.R

pvcmR Documentation

Variable Coefficients Models for Panel Data

Description

Estimators for random and fixed effects models with variable coefficients.

Usage

pvcm(
  formula,
  data,
  subset,
  na.action,
  effect = c("individual", "time"),
  model = c("within", "random"),
  index = NULL,
  ...
)

## S3 method for class 'pvcm'
summary(object, ...)

## S3 method for class 'summary.pvcm'
print(
  x,
  digits = max(3, getOption("digits") - 2),
  width = getOption("width"),
  ...
)

Arguments

formula

a symbolic description for the model to be estimated,

data

a data.frame,

subset

see lm,

na.action

see lm,

effect

the effects introduced in the model: one of "individual", "time",

model

one of "within", "random",

index

the indexes, see pdata.frame(),

...

further arguments.

object, x

an object of class "pvcm",

digits

digits,

width

the maximum length of the lines in the print output,

Details

pvcm estimates variable coefficients models. Individual or time effects are introduced, respectively, if effect = "individual" (default) or effect = "time".

Coefficients are assumed to be fixed if model = "within", i.e., separate pooled OLS models are estimated per individual (effect = "individual") or per time period (effect = "time"). Coefficients are assumed to be random if model = "random" and the model by \insertCiteSWAM:70;textualplm is estimated; it is a generalized least squares model which uses the results of the OLS models estimated per individual/time dimension (coefficient estimates are weighted averages of the single OLS estimates with weights inversely proportional to the variance-covariance matrices). The corresponding unbiased single coefficients, variance-covariance matrices, and standard errors of the random coefficients model are available in the returned object (see Value).

A test for parameter stability (homogeneous coefficients) of the random coefficients model is printed in the model's summary and is available in the returned object (see Value).

pvcm objects have print, summary and print.summary methods.

Value

An object of class c("pvcm", "panelmodel"), which has the following elements:

coefficients

the vector (numeric) of coefficients (or data frame for fixed effects),

residuals

the vector (numeric) of residuals,

fitted.values

the vector of fitted values,

vcov

the covariance matrix of the coefficients (a list for fixed effects model (model = "within")),

df.residual

degrees of freedom of the residuals,

model

a data frame containing the variables used for the estimation,

call

the call,

args

the arguments of the call,

random coefficients model only (model = "random"):

Delta

the estimation of the covariance matrix of the coefficients,

single.coefs

matrix of unbiased coefficients of single estimations,

single.vcov

list of variance-covariance matrices for single.coefs,

single.std.error

matrix of standard errors of single.coefs,

chisq.test

htest object: parameter stability test (homogeneous coefficients),

separate OLS estimations only (model = "within"):

std.error

a data frame containing standard errors for all coefficients for each single regression.

Author(s)

Yves Croissant, Kevin Tappe

References

\insertAllCited \insertRef

SWAM:71plm

\insertRef

GREE:18plm

\insertRef

POI:03plm

\insertRef

KLEI:ZEIL:10plm

Examples


data("Produc", package = "plm")
zw <- pvcm(log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp, data = Produc, model = "within")
zr <- pvcm(log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp, data = Produc, model = "random")

## replicate Greene (2018), p. 452, table 11.22/(2012), p. 419, table 11.14
summary(pvcm(log(gsp) ~ log(pc) + log(hwy) + log(water) + log(util) + log(emp) + unemp, 
             data = Produc, model = "random"))
             
## replicate Poi (2003) (need data adjustment, remaining tiny diffs are due 
## Poi's data set having more digits, not justified by the original Grunfeld data)
data(Grunfeld) # need firm = 1, 4, 3, 8, 2
Gr.Poi.2003 <- Grunfeld[c(1:20, 61:80, 41:60, 141:160, 21:40), ]
Gr.Poi.2003$firm <- rep(1:5, each = 20)
Gr.Poi.2003[c(86, 98), "inv"] <- c(261.6, 645.2)
Gr.Poi.2003[c(92), "capital"] <- c(232.6)

mod.poi <- pvcm(inv ~ value + capital, data = Gr.Poi.2003, model = "random")
summary(mod.poi)
print(mod.poi$single.coefs)
print(mod.poi$single.std.err)

## Not run: 
# replicate Swamy (1971), p. 166, table 5.2
data(Grunfeld, package = "AER") # 11 firm Grunfeld data needed from package AER
gw <- pvcm(invest ~ value + capital, data = Grunfeld, index = c("firm", "year"))
# close replication of Swamy (1970), (7.4) [remaining diffs likely due to less 
# precise numerical methods in the 1970, as supposed in Kleiber/Zeileis (2010), p. 9]
gr <- pvcm(invest ~ value + capital, data = Grunfeld, index = c("firm", "year"), model = "random")

## End(Not run)


plm documentation built on June 22, 2024, 6:54 p.m.