# ncv.test

0th

Percentile

##### Score Test for Non-Constant Error Variance

Computes a score test of the hypothesis of constant error variance against the alternative that the error variance changes with the level of the response (fitted values), or with a linear combination of predictors.

Keywords
regression, htest
##### Usage
ncv.test(model, ...)

ncv.test.lm(model, var.formula, data=NULL, subset, na.action)

ncv.test.glm(model, ...)
##### Arguments
model
an unweighted linear model, produced by lm.
var.formula
a one-sided formula for the error variance; if omitted, the error variance depends on the fitted values.
data
an optional data frame containing the variables in the model. By default the variables are taken from the environment from which ncv.test is called.
subset
an optional vector specifying a subset of observations to be used.
na.action
a function that indicates what should happen when the data contain NAs. The default is set by the na.action setting of options.
...
not for the user.
##### Details

This test is often called the Breusch-Pagan test; it was independently suggested by Cook and Weisberg (1983). ncv.test.glm is a dummy function to generate an error when a glm model is used.

##### Value

• The function returns a chisq.test object, which is usually just printed.

##### References

Breusch, T. S. and Pagan, A. R. (1979) A simple test for heteroscedasticity and random coefficient variation. Econometrica 47, 1287--1294. Cook, R. D. and Weisberg, S. (1983) Diagnostics for heteroscedasticity in regression. Biometrika 70, 1--10. Fox, J. (1997) Applied Regression, Linear Models, and Related Methods. Sage.

hccm, spread.level.plot

• ncv.test
• ncv.test.lm
• ncv.test.glm
##### Examples
data(Ornstein)
mod<-lm(interlocks~assets+sector+nation, data=Ornstein)
ncv.test(mod)
## Non-constant Variance Score Test
## Variance formula: ~ fitted.values
## Chisquare = 46.98537    Df = 1     p = 7.151835e-12
ncv.test(mod, ~ assets+sector+nation, data=Ornstein)
## Non-constant Variance Score Test
## Variance formula: ~ assets + sector + nation
## Chisquare = 74.73535    Df = 13     p = 1.066320e-10
Documentation reproduced from package car, version 0.8-3, License: GPL version 2 or newer

### Community examples

Looks like there are no examples yet.