gq.test | R Documentation |
Goldfeld-Quandt test for heteroskedastic errors. The object of test results returned by this command can be plotted using the plot()
function.
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
)
mod |
estimated linear model object or formula. If only a model formula is passed then the |
data |
if |
split |
partitions the data set into two groups. If <= 1 then |
omit.obs |
the number of central observations to be omitted. Might increase the power of the test. If <= 1 then |
ah |
character string specifying the type of the alternative hypothesis: |
order.by |
either a vector |
sig.level |
significance level. Default value: |
details |
logical value indicating whether specific details about the test should be returned. |
hyp |
logical value indicating whether the Hypotheses should be returned. |
A list object including:
hyp | character matrix of hypotheses (if hyp = TRUE ). |
results | a data frame 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. |
Goldfeld, S.M. & Quandt, R.E. (1965): Some Tests for Homoskedasticity. Journal of the American Statistical Association 60, 539-547.
wh.test
, gqtest
.
## 5 observations in group 1 with the hypothesis that the variance of group 2 is larger
gq.test(rent ~ dist, split = 5, ah = "increasing", data = data.rent)
## Ordered by population size
eu.mod <- ols(expend ~ pop + gdp + farm + votes + mship, data = data.eu)
results <- gq.test(eu.mod, split = 13, order.by = data.eu$pop, details = TRUE)
results
plot(results)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.