------------------------------------------------------------------------------- help forxtivreg28-------------------------------------------------------------------------------

Extended IV/2SLS, GMM and AC/HAC, LIML and k-class regression for panel data mo> delsFull syntax, fixed effects and first differences models

xtivreg28depvar[varlist1](varlist2=varlist_iv)[weight] [ifexp] [inrange], {fe | fd}[ivar(varname)tvar(varname)gmmbw(#)kernel(string)limlfuller(#)kclass(#)covivcuecueinit(matrix)cueoptions(string)robustcluster(varlist)orthog(varlist_ex)endog(varlist_en)redundant(varlist_ex)fwl(varlist)smallnoconstantfirstffirstsavefirstsavefprefix(prefix)rfsaverfsaverfprefix(prefix)nocollinnoidlevel(#)noheadernofootereform(string)depname(varname)plus]Replay syntax

xtivreg28[,firstffirstrflevel(#)noheadernofootereform(string)depname(varname)plus]}Version syntax

xtivreg28,version

xtivreg28may be used with time-series or panel data, in which case the data can betssetbefore usingxtivreg28; see help tsset.All

varlistsmay contain time-series operators; see help varlist.

aweights,fweights,iweights andpweights are allowed; see help weights.The syntax of predict following

xtivreg28is

predict[type]newvarname[ifexp] [inrange] [,statistic]For the fixed-effects estimator,

statisticis

ev_it, the idiosyncratic component of the error termand is available only for the estimation sample.

For the first-differences estimator,

statisticis

ev_it - v_it-1, the first-differenced idiosyncratic componentxb(X_it - X_it-1)*b_hat, the fitted valuesand are available in and out of sample. Use

e(sample)if wanted only for the estimation sample.

Description

xtivreg28implements IV/GMM estimation of the fixed-effects and first-differences panel data models with possibly endogenous regressors. It is essentially a wrapper forivreg28, which must be installed forxtivreg28to run.xtivreg28andivreg28will run under Stata 8; users with Stata 9 or later should use the more recent versions of these programs (xtivreg2,ivreg2,ivreg29, etc.).

xtivreg28supports all the estimation and reporting options ofivreg28; see help ivreg28 for full descriptions and examples. In particular, all the statistics available withivreg28(heteroskedastic, cluster- and autocorrelation-robust covariance matrix and standard errors, overidentification and orthogonality tests, first-stage and weak/underidentification statistics, etc.) are also supported byxtivreg28and will be reported with any degrees-of-freedom adjustments required for a panel data estimation.The degrees-of-freedom adjustments depend on whether the estimation is fixed-effects or first-differences, and whether it uses the

clusteroption.For fixed-effects estimation without

cluster, the covariance matrix and regression statistics (identification and overidentification statistics, first-stage regressions and tests, etc.) are adjusted for the number of fixed effects N_g. With large-sample statistics, the covariance matrix has the adjustment (N-N_g); with small-sample statistics, the adjustment is (N-N_g-K), where K is the number of regressors.For fixed-effects estimation with

cluster,xtivreg28makesnodegrees-of-freedom adjustment for the number of fixed effects. This follows the formulation of a cluster-robust covariance matrix for the fixed-effects model as originally proposed by Arellano (1987); see, e.g., Wooldridge (2002), p. 275. Stata's officialxtivreg,xtregandareg(as of version 9.1, October 2005), by contrast, use the (N-N_g-K) adjustment, which is somewhat conservative in this context.However, the approach used byxtivreg28requires that no panel overlaps more than one cluster. That is, either the panel variable is identical to the cluster variable, or panels are uniquely assigned to clusters. If any panel is contained in more than one cluster, thextivreg28approach is invalid, and it will exit with an error.First-differences estimation makes no degrees-of-freedom adjustment, irrespective of whether

clusteris used.Other features of

xtivreg28and differences vs. officialxtivreg:

xtivreg28supports only the fixed effects and the first-differences panel models; the optionfeorfdis required. GLS random effects is not supported.

xtivreg28does not estimate or report a constant with the fixed effects modelfe.First-differences estimation with

xtivreg28yields estimates identical toivreg28when the latter is supplied with all variables expressed in first-differences.

xtivreg28allows use of time series operators.For fixed-effects estimation, the data must either be

tsset, the panel id variable set withiis, or the panel id variable supplied toxtivreg28with theivaroption. For first-differences estimation, the data must betsset.

xtivreg28supports all types of weights.The R-squared reported by

xtivreg28for the fixed-effects estimation is the "within R-squared" obtained by estimating the equation in mean-deviation form.

xtivreg28supports simple fixed effects and first-differences estimation with no endogeneous variables, i.e.,(varlist2=varlist_iv)can be omitted.

Examples. use http://fmwww.bc.edu/ec-p/data/macro/abdata.dta (Layard & Nickell, Unemployment in Britain, Economica 53, 1986, from Ox dist)

. tsset id year

(

xtivregvs.xtivreg28, fixed effects). xtivreg28 ys k (n=l2.n l3.n), fe small

. xtivreg ys k (n=l2.n l3.n), fe small

(

xtivreg28vs.ivreg28vs.xtivreg, first-differences). xtivreg28 ys k (n=l.n l2.n), fd small first

. ivreg28 d.ys d.k (d.n=ld.n ld2.n), small first

. xtivreg ys k (n=l.n l2.n), fd small

Citation of xtivreg28

xtivreg28is not an official Stata command. It is a free contribution to the research community, like a paper. Please cite it as such:Schaffer, M.E., 2012. xtivreg28: Stata module to perform extended IV/2SLS, GMM and AC/HAC, LIML and k-class regression for panel data models. http://ideas.repec.org/c/boc/bocode/s456501.html

ReferencesArellano, M. 1987. Computing Robust Standard Errors for Within-Groups Estimators. Oxford Bulletin of Economics and Statistics, Vol. 49, pp. 431-34.

Baum, C.F., Schaffer, M.E., and Stillman, S. 2003. Instrumental Variables and GMM: Estimation and Testing. The Stata Journal, Vol. 3, No. 1, pp. 1-31. Unpublished working paper version: Boston College Department of Economics Working Paper No 545. http://fmwww.bc.edu/ec-p/WP545.pdf

Wooldridge, J.M. 2002. Econometric Analysis of Cross Section and Panel Data. Cambridge, MA: MIT Press.

AuthorMark E Schaffer, Heriot-Watt University, UK m.e.schaffer@hw.ac.uk

Also seeOn-line: help for ivreg2, ivreg28, overid, ivendog, ivhettest, ivreset, xtoverid, condivreg (if installed)