pvcm: Variable Coefficients Models for Panel Data

Description Usage Arguments Details Value Author(s) References Examples

View source: R/pvcm.R

Description

Estimators for random and fixed effects models with variable coefficients.

Usage

1
2
3
4
5
6
7
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,

object, x

an object of class "pvcm",

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,

digits

digits,

width

the maximum length of the lines in the print output,

...

further arguments.

Details

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

Coefficients are assumed to be fixed if model = "within" and random if model = "random". In the first case, a different model is estimated for each individual (or time period). In the second case, the Swamy (1970) model is estimated. It is a generalized least squares model which uses the results of the previous model.

Value

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

coefficients

the vector (or the list for fixed effects) of coefficients,

residuals

the vector of residuals,

fitted.values

the vector of fitted values,

vcov

the covariance matrix of the coefficients,

df.residual

degrees of freedom of the residuals,

model

a data.frame containing the variables used for the estimation,

call

the call,

Delta

the estimation of the covariance matrix of the coefficients (random effect models only),

std.error

the standard errors for all the coefficients for each individual (within models only).

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

Author(s)

Yves Croissant

References

Swamy, P.A.V.B. (1970). Efficient Inference in a Random Coefficient Regression Model, Econometrica, 38(2), pp. 311–323.

Examples

1
2
3
4
5
6
7
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 (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"))

Example output

Loading required package: Formula
[1]  1.102934e+00  1.750358e-01  6.255738e-02 -7.631249e-05  6.725799e-06
attention
[1]  3.099354e+01  4.480811e-01  1.170835e-01  4.415201e-02  2.564382e-02
[6] -1.249124e-03 -6.827831e-07
attention
Oneway (individual) effect Random coefficients model

Call:
pvcm(formula = log(gsp) ~ log(pc) + log(hwy) + log(water) + log(util) + 
    log(emp) + unemp, data = Produc, model = "random")

Balanced Panel: n=48, T=17, N=816

Residuals:
total sum of squares : 29.74077 
         id        time 
0.960118923 0.007220712 

Estimated mean of the coefficients:
              Estimate Std. Error z-value Pr(>|z|)    
(Intercept)  1.6530780  1.0833134  1.5259  0.12702    
log(pc)      0.0940755  0.0515162  1.8261  0.06783 .  
log(hwy)     0.1050114  0.1736406  0.6048  0.54534    
log(water)   0.0767189  0.0674273  1.1378  0.25520    
log(util)   -0.0149021  0.0988643 -0.1507  0.88019    
log(emp)     0.9190594  0.1044486  8.7992  < 2e-16 ***
unemp       -0.0047055  0.0020673 -2.2761  0.02284 *  
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Estimated variance of the coefficients:
            (Intercept)    log(pc)   log(hwy) log(water)  log(util)   log(emp)
(Intercept)   50.101152 -0.1269537 -5.7011050  1.1490999  0.9323094 -1.5405556
log(pc)       -0.126954  0.0921826  0.0050351 -0.0178555 -0.0306629 -0.0649625
log(hwy)      -5.701105  0.0050351  1.2347643 -0.1657787 -0.4550976 -0.0467022
log(water)     1.149100 -0.0178555 -0.1657787  0.1883437 -0.0095582 -0.1125142
log(util)      0.932309 -0.0306629 -0.4550976 -0.0095582  0.3996351  0.0118384
log(emp)      -1.540556 -0.0649625 -0.0467022 -0.1125142  0.0118384  0.4348876
unemp         -0.027161 -0.0013129  0.0020316 -0.0024191 -0.0013977  0.0068745
                  unemp
(Intercept) -0.02716134
log(pc)     -0.00131287
log(hwy)     0.00203161
log(water)  -0.00241907
log(util)   -0.00139775
log(emp)     0.00687449
unemp        0.00016044

Total Sum of Squares: 21431
Residual Sum of Squares: 36.691
Multiple R-Squared: 0.99829

plm documentation built on March 18, 2018, 1:10 p.m.