1
$\begingroup$

I am unfamiliar with the implementation used in the R package GVLMA. What are some basic tests of heteroscedasticity in linear regression models and how or where are they implemented?

$\endgroup$
  • $\begingroup$ Don't test, just graph it. $\endgroup$ – AdamO Jun 30 '15 at 19:54
  • 2
    $\begingroup$ In econometrics, various tests are often used. Maybe the most prominent one is the Breusch-Pagan test, implenented in car::ncvTest and lmtest::bptest. A particular flavour of this test is the White test. $\endgroup$ – Achim Zeileis Jun 30 '15 at 23:07
2
$\begingroup$

While I'm not as familiar with the gvlma package, we typically test for non-constant variance (heteroscedasticity) by checking residual plots. In R, this is easy to do simply by using the plot() function on the result of a lm() fit. Here's an example using a subset of the diamonds dataset:

library(ggplot2); data(diamonds);
diamonds <- subset(diamonds, carat < 1)

fit <- lm(data = diamonds, price ~ carat)
plot(fit)

We see from the residuals vs. fitted plot (the first plot that's generated using the plot() function) that the variance of the residuals increase as the fitted values increase:

enter image description here

This is the sign of heteroscedasticity.

Of course, this was a very simple regression. But the same technique can be applied to multiple linear regression. For example, we can do:

fit2 <- lm(data = diamonds, price ~ carat + cut)
plot(fit2)

And we see the same problem from the residuals vs. fitted plot.

I hope this answers your question? You should know what to do next when there is non-constant variance in your response.

$\endgroup$
  • $\begingroup$ This gives you an idea indeed, but there are also formal tests, such as GQ, White, etc. $\endgroup$ – rbm Jun 30 '15 at 17:49
1
$\begingroup$

GVLMA uses a directional test: Basically, it is calculated by fitting a regression model for the squared residuals against the ordered $x$ values and determining if there is a trend. This test is not powered to detect any difference if the residuals have symmetric behavior (often the case). A more robust version might use a smoothing spline for the ordered $x$ to visualize trends, or a semivariogram.

Lastly, you might just use a robust error estimator, like the Huber-White sandwich error, that gives you valid confidence intervals for the betas even when there is hetereoscedasticity. This is useful if your main objective is inference.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.