1% Generated by roxygen2: do not edit by hand 2% Please edit documentation in R/est_gmm.R 3\name{pgmm} 4\alias{pgmm} 5\alias{coef.pgmm} 6\alias{summary.pgmm} 7\alias{print.summary.pgmm} 8\title{Generalized Method of Moments (GMM) Estimation for Panel Data} 9\usage{ 10pgmm( 11 formula, 12 data, 13 subset, 14 na.action, 15 effect = c("twoways", "individual"), 16 model = c("onestep", "twosteps"), 17 collapse = FALSE, 18 lost.ts = NULL, 19 transformation = c("d", "ld"), 20 fsm = NULL, 21 index = NULL, 22 ... 23) 24 25\method{coef}{pgmm}(object, ...) 26 27\method{summary}{pgmm}(object, robust = TRUE, time.dummies = FALSE, ...) 28 29\method{print}{summary.pgmm}( 30 x, 31 digits = max(3, getOption("digits") - 2), 32 width = getOption("width"), 33 ... 34) 35} 36\arguments{ 37\item{formula}{a symbolic description for the model to be 38estimated. The preferred interface is now to indicate a 39multi--part formula, the first two parts describing the 40covariates and the GMM instruments and, if any, the third part 41the 'normal' instruments,} 42 43\item{data}{a \code{data.frame} (neither factors nor character vectors 44will be accepted in \code{data.frame}),} 45 46\item{subset}{see \code{\link[=lm]{lm()}},} 47 48\item{na.action}{see \code{\link[=lm]{lm()}},} 49 50\item{effect}{the effects introduced in the model, one of 51\code{"twoways"} (the default) or \code{"individual"},} 52 53\item{model}{one of \code{"onestep"} (the default) or \code{"twosteps"},} 54 55\item{collapse}{if \code{TRUE}, the GMM instruments are collapsed (default is 56\code{FALSE}),} 57 58\item{lost.ts}{the number of lost time series: if \code{NULL}, this is 59automatically computed. Otherwise, it can be defined by the 60user as a numeric vector of length 1 or 2. The first element is 61the number of lost time series in the model in difference, the 62second one in the model in level. If the second element is 63missing, it is set to the first one minus one,} 64 65\item{transformation}{the kind of transformation to apply to the 66model: either \code{"d"} (the default value) for the 67"difference GMM" model or \code{"ld"} for the "system GMM" model,} 68 69\item{fsm}{the matrix for the one step estimator: one of \code{"I"} 70(identity matrix) or \code{"G"} (\eqn{=D'D} where \eqn{D} is the 71first--difference operator) if \code{transformation="d"}, one of 72\code{"GI"} or \code{"full"} if \code{transformation="ld"},} 73 74\item{index}{the indexes,} 75 76\item{\dots}{further arguments.} 77 78\item{object, x}{an object of class \code{"pgmm"},} 79 80\item{robust}{for pgmm's summary method: if \code{TRUE} (default), robust inference 81is performed in the summary,} 82 83\item{time.dummies}{for pgmm's summary method: if \code{TRUE}, the estimated 84coefficients of time dummies are present in the table of coefficients; 85default is \code{FALSE}, thus time dummies are dropped in summary's coefficient 86table (argument is only meaningful if there are time dummies in the model, 87i.e., only for \code{effect = "twoways"}),} 88 89\item{digits}{digits,} 90 91\item{width}{the maximum length of the lines in the print output.} 92} 93\value{ 94An object of class \code{c("pgmm","panelmodel")}, which has the 95following elements: 96 97\item{coefficients}{the vector (or the list for fixed effects) of 98coefficients,} 99\item{residuals}{the list of residuals for each individual,} 100\item{vcov}{the covariance matrix of the coefficients,} 101\item{fitted.values}{the vector of fitted values,} 102\item{df.residual}{degrees of freedom of the residuals,} 103\item{model}{a list containing the variables used for the 104estimation for each individual,} 105\item{W}{a list containing the instruments for each individual (a matrix per 106list element) (two lists in case of system GMM,} 107\item{A1}{the weighting matrix for the one--step estimator,} 108\item{A2}{the weighting matrix for the two--steps estimator,} 109\item{call}{the call.} 110 111In addition, it has attribute \code{"pdim"} which contains the pdim object for 112model. 113 114It has \code{print}, \code{summary} and \code{print.summary} methods. 115} 116\description{ 117Generalized method of moments estimation for static or dynamic 118models with panel data. 119} 120\details{ 121\code{pgmm} estimates a model for panel data with a generalized method 122of moments (GMM) estimator. The description of the model to 123estimate is provided with a multi--part formula which is (or which 124is coerced to) a \code{Formula} object. The first right--hand side part 125describes the covariates. The second one, which is mandatory, 126describes the GMM instruments. The third one, which is optional, 127describes the 'normal' instruments. By default, all the variables 128of the model which are not used as GMM instruments are used as 129normal instruments with the same lag structure as the one specified 130in the model. 131 132\code{y~lag(y, 1:2)+lag(x1, 0:1)+lag(x2, 0:2) | lag(y, 2:99)} is similar to 133 134\code{y~lag(y, 1:2)+lag(x1, 0:1)+lag(x2, 0:2) | lag(y, 2:99) | lag(x1, 0:1)+lag(x2, 0:2)} 135 136and indicates that all lags from 2 of \code{y} are used 137as GMM instruments. 138 139\code{transformation} indicates how the model should be transformed for 140the estimation. \code{"d"} gives the "difference GMM" model 141\insertCite{@see @AREL:BOND:91}{plm}, \code{"ld"} the "system GMM" model 142\insertCite{@see @BLUN:BOND:98}{plm}. 143 144\code{pgmm} is an attempt to adapt GMM estimators available within the 145DPD library for GAUSS \insertCite{@see @AREL:BOND:98}{plm} and Ox 146\insertCite{@see @DOOR:AREL:BOND:12}{plm} and within the xtabond2 147library for Stata \insertCite{@see @ROOD:09}{plm}. 148} 149\examples{ 150 151data("EmplUK", package = "plm") 152 153## Arellano and Bond (1991), table 4 col. b 154z1 <- pgmm(log(emp) ~ lag(log(emp), 1:2) + lag(log(wage), 0:1) 155 + log(capital) + lag(log(output), 0:1) | lag(log(emp), 2:99), 156 data = EmplUK, effect = "twoways", model = "twosteps") 157summary(z1, robust = FALSE) 158 159## Blundell and Bond (1998) table 4 (cf. DPD for OX p. 12 col. 4) 160z2 <- pgmm(log(emp) ~ lag(log(emp), 1)+ lag(log(wage), 0:1) + 161 lag(log(capital), 0:1) | lag(log(emp), 2:99) + 162 lag(log(wage), 2:99) + lag(log(capital), 2:99), 163 data = EmplUK, effect = "twoways", model = "onestep", 164 transformation = "ld") 165summary(z2, robust = TRUE) 166 167\dontrun{ 168## Same with the old formula or dynformula interface 169## Arellano and Bond (1991), table 4, col. b 170z1 <- pgmm(log(emp) ~ log(wage) + log(capital) + log(output), 171 lag.form = list(2,1,0,1), data = EmplUK, 172 effect = "twoways", model = "twosteps", 173 gmm.inst = ~log(emp), lag.gmm = list(c(2,99))) 174summary(z1, robust = FALSE) 175 176## Blundell and Bond (1998) table 4 (cf DPD for OX p. 12 col. 4) 177z2 <- pgmm(dynformula(log(emp) ~ log(wage) + log(capital), list(1,1,1)), 178 data = EmplUK, effect = "twoways", model = "onestep", 179 gmm.inst = ~log(emp) + log(wage) + log(capital), 180 lag.gmm = c(2,99), transformation = "ld") 181summary(z2, robust = TRUE) 182} 183 184} 185\references{ 186\insertAllCited{} 187} 188\seealso{ 189\code{\link[=sargan]{sargan()}} for the Hansen--Sargan test and \code{\link[=mtest]{mtest()}} for 190Arellano--Bond's test of serial correlation. \code{\link[=dynformula]{dynformula()}} for 191dynamic formulas (deprecated). 192} 193\author{ 194Yves Croissant 195} 196\keyword{regression} 197