## ROBUSTERRORS

Econometrics questions and discussions

### ROBUSTERRORS

Hi Tom,

LINREG has a ROBUSTERRORS option, is there an equivalent for BOXJENK and for STWISE? If not how do I calculate them?

Thanks,
Amarjit
ac_1

Posts: 318
Joined: Thu Apr 15, 2010 6:30 am
Location: London, UK

### Re: ROBUSTERRORS

STWISE actually has the standard HAC standard error calculations; it's just not documented. BOXJENK does not.
TomDoan

Posts: 7457
Joined: Wed Nov 01, 2006 5:36 pm

### Re: ROBUSTERRORS

So STWISE computes Heteroskedasticity and autocorrelation-consistent (HAC) estimators by default, no option? Why does BOXJENK not?
ac_1

Posts: 318
Joined: Thu Apr 15, 2010 6:30 am
Location: London, UK

### Re: ROBUSTERRORS

STWISE has the usual set of options for HAC (ROBUSTERRORS, LAGS, LWINDOW. etc.).

BOXJENK is a much broader instruction which can estimate using methods other than least squares.
TomDoan

Posts: 7457
Joined: Wed Nov 01, 2006 5:36 pm

### Re: ROBUSTERRORS

Many Thanks. Gujarati has the matrix approach to CLRM, estimation via OLS and illustrative example. Please can you provide a reference for ARIMA numerical calculation by-hand - I am aware there may be optimisation of a log-likelihood function.
ac_1

Posts: 318
Joined: Thu Apr 15, 2010 6:30 am
Location: London, UK

### Re: ROBUSTERRORS

Use the DERIVES option on BOXJENK, and do the sandwich covariance calculation:

mcov / %resids
# dd
compute xxrobust=%xx*%cmom*%xx

where xxrobust will be the adjusted covariance matrix. That version of MCOV does the Eicker-White type of adjustment. A HAC adjustment really doesn't make sense since the residuals aren't supposed to be autocorrelated in the first place.
TomDoan

Posts: 7457
Joined: Wed Nov 01, 2006 5:36 pm

### Re: ROBUSTERRORS

Many Thanks. Here's an example using data from Greene, comparing adjusted SE, T-stat and Signif for the constant term only, please check.

Code: Select all
`** Greene, Econometric Analysis, 7th Edition* Example cut out of final draft.*open data tablef22-1.txtcalendar(m) 1990data(format=prn,org=columns) 1990:1 1994:12 date y** Center the series over the entire span of datadiff(center) y / yc*boxjenk(constant,ar=1,ma=1,derives=dd) ycmcov / %resids# ddcompute xxrobust=%xx*%cmom*%xx*disp ""disp "CONSTANT Coeff " #.######### %beta(1)disp "CONSTANT Std Error " #.######### %stderrs(1)comp tstat = %beta(1) / %STDERRS(1)disp "CONSTANT T-stat " #.######### tstatcomp pvalue = 2.0 * %TCDF(-abs(tstat),%nobs-3.0)disp "CONSTANT Signif " #.######### pvalue*disp ""disp "CONSTANT Coeff " #.######### %beta(1)disp "CONSTANT SCC Std Error " #.######### xxrobust(1,1)comp scctstat = %beta(1)/xxrobust(1,1)disp "CONSTANT SCC T-stat " #.######### scctstatcomp sccpvalue = 2.0 * %TCDF(-abs(scctstat),%nobs-3.0)disp "CONSTANT SCC Signif " #.######### sccpvalue*`

is there a reference for step-by-step ARIMA numerical calculation by-hand?
ac_1

Posts: 318
Joined: Thu Apr 15, 2010 6:30 am
Location: London, UK

### Re: ROBUSTERRORS

XXROBUST is the robust covariance matrix so the standard errors are the square roots of the diagonal elements, not the diagonal elements themselves.

That's the standard calculation for Eicker-White standard errors in non-linear least squares.
TomDoan

Posts: 7457
Joined: Wed Nov 01, 2006 5:36 pm

### Re: ROBUSTERRORS

Sorry.

Code: Select all
`*disp ""disp "CONSTANT Coeff " #.######### %beta(1)disp "CONSTANT SCC Std Error " #.######### (xxrobust(1,1))**0.5comp scctstat = %beta(1)/(xxrobust(1,1))**0.5disp "CONSTANT SCC T-stat " #.######### scctstatcomp sccpvalue = 2.0 * %TCDF(-abs(scctstat),%nobs-3.0)disp "CONSTANT SCC Signif " #.######### sccpvalue*`
ac_1

Posts: 318
Joined: Thu Apr 15, 2010 6:30 am
Location: London, UK

### Re: ROBUSTERRORS

That looks correct, though you probably would be better off using %TTEST rather than monkeying around with %TCDF:

https://estima.com/ratshelp/functionlist.html#ttest

Note also that %NDF will have the T-k so you don't have to hard-code the degrees of freedom adjustment.
TomDoan

Posts: 7457
Joined: Wed Nov 01, 2006 5:36 pm

### Re: ROBUSTERRORS

Comparing BOXJENK with manual calculation of Eicker-White SE's and LINREG(ROBUSTERRORS) I get different results, the main being for the constant. Why?
Also, are the Eicker-White SE's still relevant if I use MAXL (which does slow down estimation in recursive/rolling regressions) with BOXJENK?

Code: Select all
`** Greene, Econometric Analysis, 7th Edition* Example cut out of final draft.*open data tablef22-1.txtcalendar(m) 1990data(format=prn,org=columns) 1990:1 1994:12 date y** Center the series over the entire span of datadiff(center) y / yc**boxjenk(constant,ar=6,derives=dd) yc**  Eicker-White SE's*mcov / %resids# ddcompute xxrobust=%xx*%cmom*%xxdo i = 1, %nreg   comp tStat = %beta(i)/xxrobust(i,i)**0.5   comp pValue = %ttest(-abs(tStat),%ndf)   disp "tStat " # i  #.#########  tStat "pValue" # i  #.######### pValueend do ilinreg(robusterrors) y# constant y{1 to 6}`
ac_1

Posts: 318
Joined: Thu Apr 15, 2010 6:30 am
Location: London, UK

### Re: ROBUSTERRORS

TomDoan

Posts: 7457
Joined: Wed Nov 01, 2006 5:36 pm

### Re: ROBUSTERRORS

Apologies:

Code: Select all
`linreg(robusterrors) yc# constant yc{1 to 6}`

ac_1

Posts: 318
Joined: Thu Apr 15, 2010 6:30 am
Location: London, UK

### Re: ROBUSTERRORS

I have had a read and I remain unclear. BOXJENK is estimating by LS Gauss-Newton. LINREG is estimating by Least Squares. The Eicker-White SE's are similar, the main difference being in the constant Coeff. Can I get the same results using BOXJENK and LINREG, and if so how?
ac_1

Posts: 318
Joined: Thu Apr 15, 2010 6:30 am
Location: London, UK

### Re: ROBUSTERRORS

ac_1 wrote:I have had a read and I remain unclear. BOXJENK is estimating by LS Gauss-Newton. LINREG is estimating by Least Squares. The Eicker-White SE's are similar, the main difference being in the constant Coeff. Can I get the same results using BOXJENK and LINREG, and if so how?

There are different ways of handling the intercept/mean which is what is described in the paragraph from the User's Guide. BOXJENK uses one way (the more natural way for the types of models it does); LINREG another. If you're doing conditional least squares for an AR model in BOXJENK (rather than maximum likelihood), it produces identical models, just with different parametrizations of the constant/mean.
TomDoan

Posts: 7457
Joined: Wed Nov 01, 2006 5:36 pm

Next