pvcm {plm} | R 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 |
subset |
see |
na.action |
see |
effect |
the effects introduced in the model: one of
|
model |
one of |
index |
the indexes, see |
... |
further arguments. |
object , x |
an object of class |
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
Swamy (1970) 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 ( |
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.std.error |
matrix of standard errors of |
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
Swamy PAVB (1970). “Efficient Inference in a Random Coefficient Regression Model.” Econometrica, 38, 311–323.
Swamy PAVB (1971). Statistical Inference in Random Coefficient Regression Models. Springer.
Greene WH (2018). Econometric Analysis, 8th edition. Prentice Hall.
Poi BP (2003). “From the help desk: Swamy’s random-coefficients model.” Stata Journal, 3(3), 302–308.
Kleiber C, Zeileis A (2010). “The Grunfeld Data at 50.” German Economic Review, 11, 404-417. https://doi.org/10.1111/j.1468-0475.2010.00513.x.
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)