General FGLS estimators for panel data (balanced or unbalanced)
pggls(
formula,
data,
subset,
na.action,
effect = c("individual", "time"),
model = c("within", "pooling", "fd"),
index = NULL,
...
)
# S3 method for class 'pggls'
summary(object, ...)
# S3 method for class 'summary.pggls'
print(
x,
digits = max(3, getOption("digits") - 2),
width = getOption("width"),
...
)
# S3 method for class 'pggls'
residuals(object, ...)a symbolic description of the model to be estimated,
a data.frame,
see lm(),
see lm(),
the effects introduced in the model, one of
"individual" or "time",
one of "within", "pooling", "fd",
the indexes, see pdata.frame(),
further arguments.
an object of class pggls,
digits,
the maximum length of the lines in the print output,
An object of class c("pggls","panelmodel") containing:
the vector of coefficients,
the vector of residuals,
the vector of fitted values,
the covariance matrix of the coefficients,
degrees of freedom of the residuals,
a data.frame containing the variables used for the estimation,
the call,
the estimated intragroup (or cross-sectional, if
effect = "time") covariance of errors,
pggls is a function for the estimation of linear panel models by
general feasible generalized least squares, either with or without
fixed effects. General FGLS is based on a two-step estimation
process: first a model is estimated by OLS (model = "pooling"),
fixed effects (model = "within") or first differences
(model = "fd"), then its residuals are used to estimate an error
covariance matrix for use in a feasible-GLS analysis. This framework allows
the error covariance structure inside every group
(if effect = "individual", else symmetric) of observations to be fully
unrestricted and is therefore robust against any type of intragroup
heteroskedasticity and serial correlation. Conversely, this
structure is assumed identical across groups and thus general FGLS
estimation is inefficient under groupwise heteroskedasticity. Note
also that this method requires estimation of \(T(T+1)/2\)
variance parameters, thus efficiency requires N >> T
(if effect = "individual", else the opposite).
If model = "within" (the default) then a FEGLS (fixed effects GLS, see
Wooldridge, Ch. 10.5) is estimated; if model = "fd" a FDGLS
(first-difference GLS). Setting model = "pooling" produces an unrestricted
FGLS model (see ibid.) (model = "random" does the same, but using this value
is deprecated and included only for retro–compatibility reasons).
Im KS, Ahn SC, Schmidt P, Wooldridge JM (1999). “Efficient estimation of panel data models with strictly exogenous explanatory variables.” Journal of Econometrics, 93(1), 177 - 201. ISSN 0304-4076, https://doi.org/10.1016/S0304-4076(99)00008-1.
Kiefer NM (1980). “Estimation of fixed effect models for time series of cross-sections with arbitrary intertemporal covariance.” Journal of Econometrics, 14(2), 195–202.
Wooldridge JM (2002). Econometric Analysis of Cross–Section and Panel Data. MIT Press.
Wooldridge JM (2010). Econometric Analysis of Cross–Section and Panel Data, 2nd edition. MIT Press.
data("Produc", package = "plm")
zz_wi <- pggls(log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp,
data = Produc, model = "within")
summary(zz_wi)
#> Oneway (individual) effect Within FGLS model
#>
#> Call:
#> pggls(formula = log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp,
#> data = Produc, model = "within")
#>
#> Balanced Panel: n = 48, T = 17, N = 816
#>
#> Residuals:
#> Min. 1st Qu. Median 3rd Qu. Max.
#> -0.117504866 -0.023705713 -0.004716909 0.017288320 0.177767615
#>
#> Coefficients:
#> Estimate Std. Error z-value Pr(>|z|)
#> log(pcap) -0.00104277 0.02900641 -0.0359 0.9713
#> log(pc) 0.17151298 0.01807934 9.4867 < 2.2e-16 ***
#> log(emp) 0.84449144 0.02042362 41.3488 < 2.2e-16 ***
#> unemp -0.00357102 0.00047319 -7.5468 4.462e-14 ***
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#> Total Sum of Squares: 849.81
#> Residual Sum of Squares: 1.1623
#> Multiple R-squared: 0.99863
zz_pool <- pggls(log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp,
data = Produc, model = "pooling")
summary(zz_pool)
#> Oneway (individual) effect General FGLS model
#>
#> Call:
#> pggls(formula = log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp,
#> data = Produc, model = "pooling")
#>
#> Balanced Panel: n = 48, T = 17, N = 816
#>
#> Residuals:
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> -0.255736 -0.070199 -0.014124 -0.008909 0.039118 0.455461
#>
#> Coefficients:
#> Estimate Std. Error z-value Pr(>|z|)
#> (Intercept) 2.26388494 0.10077679 22.4643 < 2.2e-16 ***
#> log(pcap) 0.10566584 0.02004106 5.2725 1.346e-07 ***
#> log(pc) 0.21643137 0.01539471 14.0588 < 2.2e-16 ***
#> log(emp) 0.71293894 0.01863632 38.2553 < 2.2e-16 ***
#> unemp -0.00447265 0.00045214 -9.8921 < 2.2e-16 ***
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#> Total Sum of Squares: 849.81
#> Residual Sum of Squares: 7.5587
#> Multiple R-squared: 0.99111
zz_fd <- pggls(log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp,
data = Produc, model = "fd")
summary(zz_fd)
#> Oneway (individual) effect First-Difference FGLS model
#>
#> Call:
#> pggls(formula = log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp,
#> data = Produc, model = "fd")
#>
#> Balanced Panel: n = 48, T = 17, N = 816
#>
#> Residuals:
#> Min. 1st Qu. Median Mean 3rd Qu. Max.
#> -0.0847594 -0.0103758 0.0024378 0.0007254 0.0133336 0.1018213
#>
#> Coefficients:
#> Estimate Std. Error z-value Pr(>|z|)
#> (Intercept) 0.00942926 0.00106337 8.8673 < 2e-16 ***
#> log(pcap) -0.04400764 0.02911083 -1.5117 0.13060
#> log(pc) -0.03100727 0.01248722 -2.4831 0.01302 *
#> log(emp) 0.87411813 0.02077388 42.0777 < 2e-16 ***
#> unemp -0.00483240 0.00040668 -11.8825 < 2e-16 ***
#> ---
#> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#> Total Sum of Squares: 849.81
#> Residual Sum of Squares: 0.33459
#> Multiple R-squared: 0.99961