Skip to content
All library documents

Newey–West Covariance Estimates Do Not Produce Corrected Residuals

Article Quant Q&A · Author: YemenBlues

Summary

The document asks how to obtain residuals adjusted for heteroscedasticity and autocorrelation when testing whether the alphas in a factor model are jointly zero. Its answer explains that the Newey–West estimator in the R sandwich package returns a heteroscedasticity and autocorrelation consistent covariance matrix for the regression coefficients. Taking the square roots of the matrix diagonal gives the corresponding standard errors; a lag setting can be specified to reflect the desired autocorrelation structure.

This adjusts coefficient uncertainty and inference, not the fitted residuals themselves. The response therefore clarifies what the reported correction can supply, but it does not provide corrected residuals or a procedure for conducting a robust joint-alpha test such as a robust version of the GRS test. Researchers should distinguish covariance estimates used for inference from residual values produced by the regression. The note also does not discuss assumptions or how to choose the lag length.

Key ideas

  • Newey–West estimates a regression coefficient covariance matrix that is robust to heteroscedasticity and autocorrelation.
  • Standard errors can be obtained from the square roots of the covariance matrix diagonal.
  • A lag setting can be chosen to represent the assumed autocorrelation structure.
  • Robust coefficient covariance estimates do not create adjusted residuals.

Tags

Full text
# GRS Test in R with robust residuals


# GRS Test in R with robust residuals












I'm testing certain asset pricing factor models (e.g. Fama and French 3 factor model) and want to check if the alphas of my time series regressions are jointly zero.

Most papers use the Gibbons, Ross, Shanken (1989) Test to do so.

I buildt the test by myself in R, but I want to do it with robust residuals. How do I get them, corrected for heteroscedasticity and autocorrelation with e.g. Newey West?

This is how my regressions looks like:

```
FF3 <- lm(Excess_Return ~ RMRF + SMB + HML)
```

If I do:

```
FF3_corrected <- coeftest(FF3, vcov = NeweyWest)
```

Then R just shows me the corrected coefficients, but I need the corrected residuals...

## Answer by Alba (score 2)

https://quant.stackexchange.com/a/55349

You can do the following:

Load the sandwich package, which is used for correcting covariance matrices.

```
library(sandwich)
```

Run the model.

```
FF3 <- lm(Excess_Return ~ RMRF + SMB + HML)
```

Obtain the NeweyWest-corrected covariance matrix. Change the "lag" argument if you have a specific lag structure in mind.

```
rcovmatrix <- NeweyWest(FF3)
```

The corrected standard errors are the square root of the diagonal of this matrix:

```
rstderrors <- sqrt(diag(rcovmatrix))
rstderrors
```

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.