plm (version 1.6-5)

ercomp: Estimation of the error components

Description

This function enables the estimation of the variance components of a panel model.

Usage

ercomp(object, ...) "ercomp"(object, data, effect = c("individual", "time", "twoways"), method = c("swar", "walhus", "amemiya","nerlove"), dfcor = NULL, index = NULL, ...) "ercomp"(object, ...) "print"(x, digits= max(3, getOption("digits") - 3), ...)

Arguments

object
a formula or a plm object,
data
a data.frame,
effect
the effects introduced in the model, see lm for details,
method
method of estimation for the variance components, see lm for details,
dfcor
a numeric vector of length 2 indicating which degree of freedom should be used,
index
the indexes,
x
a ercomp object,
digits
digits,
...
further arguments.

Value

An object of class "ercomp": a list containing a list called sigma2 which contains the estimates of the variance components, and theta which is the parameters used for the transformation of the variables.

References

Amemiya, T. (1971) The estimation of the variances in a variance--components model, International Economic Review, 12(1), pp. 1--13.

Nerlove, M. (1971) Further evidence on the estimation of dynamic economic relations from a time--series of cross--sections, Econometrica, 39(2), pp. 359--382.

Swamy, P.A.V.B. and Arora, S.S. (1972) The exact finite sample properties of the estimators of coefficients in the error components regression models, Econometrica, 40(2), pp. 261--275.

Wallace, T.D. and Hussain, A. (1969) The use of error components models in combining cross section with time series data, Econometrica, 37(1), pp. 55--72.

See Also

plm where the estimates of the variance components are used if a random effects model is estimated

Examples

Run this code
data("Produc", package = "plm")
# an example of the formula method
ercomp(log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp, data = Produc,
       method = "walhus", effect = "time")
# same with the plm method
z <- plm(log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp,
         data = Produc, random.method = "walhus",
         effect = "time", model = "random")
ercomp(z)
# a two-ways model
ercomp(log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp, data = Produc,
       method = "amemiya",effect = "twoways")

Run the code above in your browser using DataLab