gqtest {lmtest} | R Documentation |
Goldfeld-Quandt test against heteroskedasticity.
gqtest(formula, point = 0.5, fraction = 0, alternative = c("greater", "two.sided", "less"), order.by = NULL, data = list())
formula |
a symbolic description for the model to be tested
(or a fitted |
point |
numerical. If |
fraction |
numerical. The number of central observations to be omitted.
If |
alternative |
a character string specifying the alternative hypothesis. The default is to test for increasing variances. |
order.by |
Either a vector |
data |
an optional data frame containing the variables in the model.
By default the variables are taken from the environment which |
The Goldfeld-Quandt test compares the variances of two submodels divided by a specified breakpoint and rejects if the variances differ.
Under H_0 the test statistic of the Goldfeld-Quandt test follows an F
distribution with the degrees of freedom as given in parameter
.
Examples can not only be found on this page, but also on the help pages of the
data sets bondyield
, currencysubstitution
,
growthofmoney
, moneydemand
,
unemployment
, wages
.
A list with class "htest"
containing the following components:
statistic |
the value of the test statistic. |
p.value |
the p-value of the test. |
parameter |
degrees of freedom. |
method |
a character string indicating what type of test was performed. |
data.name |
a character string giving the name(s) of the data. |
S.M. Goldfeld & R.E. Quandt (1965), Some Tests for Homoskedasticity. Journal of the American Statistical Association 60, 539–547
W. Krämer & H. Sonnberger (1986), The Linear Regression Model under Test. Heidelberg: Physica
## generate a regressor x <- rep(c(-1,1), 50) ## generate heteroskedastic and homoskedastic disturbances err1 <- c(rnorm(50, sd=1), rnorm(50, sd=2)) err2 <- rnorm(100) ## generate a linear relationship y1 <- 1 + x + err1 y2 <- 1 + x + err2 ## perform Goldfeld-Quandt test gqtest(y1 ~ x) gqtest(y2 ~ x)