1% Generated by roxygen2: do not edit by hand 2% Please edit documentation in R/est_ggls.R 3\name{pggls} 4\alias{pggls} 5\alias{summary.pggls} 6\alias{print.summary.pggls} 7\alias{residuals.pggls} 8\title{General FGLS Estimators} 9\usage{ 10pggls( 11 formula, 12 data, 13 subset, 14 na.action, 15 effect = c("individual", "time"), 16 model = c("within", "random", "pooling", "fd"), 17 index = NULL, 18 ... 19) 20 21\method{summary}{pggls}(object, ...) 22 23\method{print}{summary.pggls}( 24 x, 25 digits = max(3, getOption("digits") - 2), 26 width = getOption("width"), 27 ... 28) 29 30\method{residuals}{pggls}(object, ...) 31} 32\arguments{ 33\item{formula}{a symbolic description of the model to be estimated,} 34 35\item{data}{a \code{data.frame},} 36 37\item{subset}{see \code{\link[=lm]{lm()}},} 38 39\item{na.action}{see \code{\link[=lm]{lm()}},} 40 41\item{effect}{the effects introduced in the model, one of 42\code{"individual"} or \code{"time"},} 43 44\item{model}{one of \code{"within"}, \code{"pooling"}, \code{"random"} or \code{"fd"},} 45 46\item{index}{the indexes, see \code{\link[=pdata.frame]{pdata.frame()}},} 47 48\item{\dots}{further arguments.} 49 50\item{object, x}{an object of class \code{pggls},} 51 52\item{digits}{digits,} 53 54\item{width}{the maximum length of the lines in the print output,} 55} 56\value{ 57An object of class \code{c("pggls","panelmodel")} containing: 58\item{coefficients}{the vector of coefficients,} 59\item{residuals}{the vector of residuals,} 60\item{fitted.values}{the vector of fitted values,} 61\item{vcov}{the covariance matrix of the coefficients,} 62\item{df.residual}{degrees of freedom of the residuals,} 63\item{model}{a data.frame containing the variables used for the 64estimation,} 65\item{call}{the call,} 66\item{sigma}{the estimated intragroup (or cross-sectional, if 67\code{effect = "time"}) covariance of errors,} 68} 69\description{ 70General FGLS estimators for panel data (balanced or unbalanced) 71} 72\details{ 73\code{pggls} is a function for the estimation of linear panel models by 74general feasible generalized least squares, either with or without 75fixed effects. General FGLS is based on a two-step estimation 76process: first a model is estimated by OLS (\code{model = "pooling"}), 77fixed effects (\code{model = "within"}) or first differences (\code{model = "fd"}), then its residuals are used to estimate an error covariance 78matrix for use in a feasible-GLS analysis. This framework allows 79the error covariance structure inside every group (if \code{effect = "individual"}, else symmetric) of observations to be fully 80unrestricted and is therefore robust against any type of intragroup 81heteroskedasticity and serial correlation. Conversely, this 82structure is assumed identical across groups and thus general FGLS 83estimation is inefficient under groupwise heteroskedasticity. Note 84also that this method requires estimation of \eqn{T(T+1)/2} 85variance parameters, thus efficiency requires N >> T (if \code{effect = "individual"}, else the opposite). Setting \code{model = "random"} or 86\code{model = "pooling"}, both produce an unrestricted FGLS model as in 87Wooldridge, Ch. 10.5, although the former is deprecated and 88included only for retro--compatibility reasons. If \code{model = "within"} (the default) then a FEGLS (fixed effects GLS, see ibid.) 89is estimated; if \code{model = "fd"} a FDGLS (first-difference GLS). 90} 91\examples{ 92 93data("Produc", package = "plm") 94zz_wi <- pggls(log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp, 95 data = Produc, model = "within") 96summary(zz_wi) 97 98zz_pool <- pggls(log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp, 99 data = Produc, model = "pooling") 100summary(zz_pool) 101 102zz_fd <- pggls(log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp, 103 data = Produc, model = "fd") 104summary(zz_fd) 105 106 107} 108\references{ 109\insertRef{IM:SEUN:SCHM:WOOL:99}{plm} 110 111\insertRef{KIEF:80}{plm} 112 113\insertRef{WOOL:02}{plm} 114 115\insertRef{WOOL:10}{plm} 116} 117\author{ 118Giovanni Millo 119} 120\keyword{regression} 121