gq.test: Goldfeld-Quandt Test

Description Usage Arguments Details Value References See Also Examples

View source: R/gq.test.R


Goldfeld-Quandt test for heteroskedastic errors.


gq.test(mod, data = list(), split = 0.5, omit.obs = 0, ah = c("increasing", "unequal", "decreasing"), = NULL, sig.level = 0.05, details = FALSE, hyp = TRUE)



Estimated linear model object or formula. If only a model formula is passed then the data argument must be specified.


If mod is a formula then the corresponding dataframe has to be specified.


Partitions the dataset into two groups. If <= 1 then split is a percentage value such that T*split observations are in the first partition. If split >= 1 it is interpreted as the index of the partitioning observation, i.e. the number of observations in the first group.


The number of central observations to be omitted. Might increase the power of the test. If <= 1 then split is the percentage value of all observations, otherwise it is interpreted as absolute number.


Character string specifying the type of the alternative hypothesis: "increasing" (variance increases from group 1 to group 2), "decreasing" (variance decreases from group 1 to group 2), "unequal" (variances are unequal between the groups). The default is to test for increasing variances.

Either a vector z or a formula with a single explanatory variable like ~ z. The observations in the model are ordered by the size of z. If set to NULL (the default) the observations are assumed to be ordered.


Significance level. Default value: sig.level = 0.05.


Logical value indicating whether specific details about the test should be returned.


Logical value indicating whether the Hypotheses should be returned.


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 the two groups.

This implementation of the test is based on gqtest() from package lmtest.


List including:

hyp Character matrix of hypotheses (if hyp = TRUE).
results A dataframe of basic test results.
hreg1 Matrix of regression results in Group I.
stats1 Additional statistic of regression in Group I.
hreg2 Matrix of regression results in Group II.
stats2 Additional statistic of regression in Group II.
nulldist Type of the Null distribution with its parameters.


S.M. Goldfeld & R.E. Quandt (1965), Some Tests for Homoskedasticity. Journal of the American Statistical Association 60, 539–547

See Also

wh.test, gqtest


gq.test(rent ~ dist, split = 5, ah = "increasing", data =

eu.mod <- lm(expend ~ pop + gdp + farm + votes + mship, data =
gq.test(eu.mod, split = 13, =$pop, details = TRUE)

andronikoss/desk documentation built on June 3, 2017, 7:05 p.m.