-------------------------------------------------------------------------------
help for newey2                                  (SSC distribution XX XXX 2002)
-------------------------------------------------------------------------------

Extended newey, regression with Newey-West standard errors

newey2 depvar [varlist1] [(varlist2=varlist_iv)] [weight] [if exp] [in range], lag(#) [i(varname) t(varname) force noconstant level(#) ]

neweyvif

neweydmexog [varlist3]

Description

newey2 provides extensions to Stata's official newey. It accepts panel as well as time series data sets, and can instrument variables. For time series data without instruments, newey2 behaves the same as newey.

neweyvif works like Stata's official vif but can run after newey, as well as after newey2 without instrumented variables. It computes variance inflation factors; see help vif. neweydmexog is an extension of the unofficial Stata command dmexog that runs after newey2 with instrumental variables. It tests for consistency of OLS after an instrumental variables regression; see net search dmexog.

aweights are allowed in newey2; see help weights. They are not allowed in neweydmexog.

newey shares the features of all estimation commands; see help est.

The syntax of predict following newey2 is

predict [type] newvarname [if exp] [in range] [, [ xb | residuals | stdp ] ]

xb, resid, and stdp are available both in and out of sample; type "predict ... if e(sample) ..." if wanted only for the estimation sample.

newey2 produces Newey-West standard errors for coefficients estimated by OLS or 2SLS. The error structure is assumed to be heteroskedastic and possibly autocorrelated up to some lag.

For panel data sets, newey2 computes pooled OLS or 2SLS estimates; it does not implement panel models such as fixed or random effects. newey2 handles missing observations differently for time series and panel data sets. Consider the example of a time series data set containing gaps, which is then recast using tsset as a panel data set with one group. newey and newey2 will not run on the time series version without force; with force they treat available observations as equally spaced. After the set is cast as a panel, newey2 will run without , force, and will assume zero serial correlation with missing observations.

For both time series and panel data sets, newey2 can instrument variables using the same syntax as ivreg; see help ivreg. In computing the Newey-West sum for the second-stage regression, newey2 uses residuals e=Y-XB where X contains all actual, not instrumented, values.

If lag(0) is specified, the variance estimates produced by newey2 are the Huber/White/sandwich robust variance estimates calculated by regress, robust or ivreg, robust; see help regress or help ivreg.

Options for newey2

lag(#) is not optional; it specifies the maximum lag to consider in the autocorrelation structure.

t(varname) specifies the variable recording the time of each observation. If this option is not used, t must already have been set using tis or tsset; see help tis and help tsset. If the data set is a time series rather than a panel and observations are not equally spaced in time, you must use the force option.

i(varname) specifies the variable recording the "group," "panel," or "independent unit" of each observation. newey2 will treat the data set as a panel set if this option is used, or if the set has already been configured as such with iis or tsset.

For time series, force specifies that estimation is to be forced even though t() shows the data not to be equally spaced. newey2 will estimate the model assuming the lags based on the data ordered by t() are appropriate. force has no effect for panel data sets.

noconstant specifies that no intercept is to be included in the model.

level(#) specifies the confidence level, in percent, for confidence intervals; see help level.

Options for predict

xb, the default, calculates the linear prediction.

residuals calculates the residuals of the linear prediction.

stdp calculates the standard error of the linear prediction.

Example

. newey2 usr idle sysv, lag(3) t(time)

. newey2 usr idle (sysv = month temperature), lag(0) . neweyvif

. tsset countrycode period . newey2 gdpg lgdp (aid = egypt centam), lag(1) . neweydmexog

Author

David Roodman, Center for Global Development, USA droodman@cgdev.org

Also see

Manual: [U] 23 Estimation and post-estimation commands, [U] 29 Overview of model estimation in Stata, [R] newey [R] regress, [R] regression diagnostics On-line: help for est, postest; regress, svyreg, xtgls, xtpcse, regdiag, regress