gq.test: Goldfeld-Quandt Test

Description Usage Arguments Details Value References See Also Examples

View source: R/gq.test.R

Description

Goldfeld-Quandt test for heteroskedastic errors.

Usage

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

Arguments

mod

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

data

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

split

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.

omit.obs

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.

ah

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.

order.by

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.

sig.level

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

details

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

hyp

Logical value indicating whether the Hypotheses should be returned.

Details

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.

Value

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.

References

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

Examples

1
2
3
4
gq.test(rent ~ dist, split = 5, ah = "increasing", data = data.rent)

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

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