Estimation with Newey-West correction on standard errors
[rnwest1]=nwest1(namey,varargin)
* y = a (nobsx1) vector of an endogenous variable
* x = a (nobs x k) matrix of exogenous variables
* win = a scalar, the length of the Barlett window (optional; default: floor(5*size(y,1)^0.25))
* rnwest1 = a results tlist with
- rnwest1('meth') = 'Newey-West''s'
- rnwest1('y') = y data vector
- rnwest1('x') = x data matrix
- rnwest1('nobs') = # observations
- rnwest1('nvar') = # variables
- rnwest1('beta') = bhat
- rnwest1('yhat') = yhat
- rnwest1('resid') = residuals
- rnwest1('vcovar') = estimated variance-covariance matrix of beta
- rnwest1('sige') = estimated variance of the residuals
- rnwest1('sigu') = sum of squared residuals
- rnwest1('ser') = standard error of the regression
- rnwest1('tstat') = t-stats
- rnwest1('pvalue') = pvalue of the betas
- rnwest1('dw') = Durbin-Watson Statistic
- rnwest1('condindex') = multicolinearity cond index
- rnwest1('prescte') = boolean indicating the presence or absence of a constant in the regression
- rnwest1('rsqr') = rsquared
- rnwest1('rbar') = rbar-squared
- rnwest1('f') = F-stat for the nullity of coefficients other than the constant
- rnwest1('pvaluef') = its significance level
load(GROCERDIR+'/data/bdhenderic.dat'); bounds('1964q3','1989q2'); rols=ols('del(lm1-lp)','del(lp)','del(lagts(1,lm1-lp-ly))','rnet', 'lagts(1,lm1-lp-ly)', 'const'); //performs ols for Hendry and Ericsson (1991) equation 6 r = nwest1(rols('y',rols('x'),8) // Applies the Newet-west correction to Hendry and Ericsson regression with a Barlett Window with a length of 8. | ![]() | ![]() |