Description Usage Arguments Details Value Author(s) References Examples
Estimators for random and fixed effects models with variable coefficients.
1 2 3 4 5 6 7 
formula 
a symbolic description for the model to be estimated, 
object, x 
an object of class 
data 
a 
subset 
see 
na.action 
see 
effect 
the effects introduced in the model: one of

model 
one of 
index 
the indexes, see 
digits 
digits, 
width 
the maximum length of the lines in the print output, 
... 
further arguments. 
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.
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 
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.
Yves Croissant
Swamy, P.A.V.B. (1970). Efficient Inference in a Random Coefficient Regression Model, Econometrica, 38(2), pp. 311–323.
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"))

Loading required package: Formula
[1] 1.102934e+00 1.750358e01 6.255738e02 7.631249e05 6.725799e06
attention
[1] 3.099354e+01 4.480811e01 1.170835e01 4.415201e02 2.564382e02
[6] 1.249124e03 6.827831e07
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 zvalue 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 < 2e16 ***
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 RSquared: 0.99829
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.