AI Glossary / Statistics and probability / Intermediate
Goldfeld - Quandt test
Definition
The Goldfeld - Quandt test is a test for heteroscedasticity that compares residual variance estimates from two separately fitted regression subsamples. Observations are commonly ordered by a variable thought to influence error spread, then divided into lower and higher groups, sometimes leaving out central observations. Under appropriate classical regression assumptions, a ratio of the two residual mean squares is compared with an F distribution to assess equal error variance.
What it means
A regression model can have a similar mean relationship across cases while its errors become more variable in one part of the data. For instance, predicting costs for large projects may involve more uncertainty than predicting costs for small projects.
The Goldfeld - Quandt approach makes that comparison explicit. It fits the mean model separately within two selected groups and compares the remaining spread after allowing for the fitted predictors. Comparing raw response variances would answer a different question because different mean levels can themselves create different observed spreads.
The test is particularly interpretable when there is a reason to expect an ordered increase or decrease in variance. It does not detect every possible heteroscedastic pattern equally well.
How it works
Choose the ordering variable, split point, optional omitted middle segment, and direction of the alternative before examining test significance. Keep the response and predictors aligned when sorting. Fit the same specified regression form separately in each retained group, ensuring both designs have adequate rank and observations.
Let group j have residual sum of squares SSE_j and residual degrees of freedom df_j. Estimate its error variance by s_j² = SSE_j/df_j. For an increasing-variance alternative, calculate F = s_high²/s_low² and use numerator degrees of freedom df_high and denominator degrees of freedom df_low.
The classical F reference requires independent normally distributed errors, a correctly specified mean model, and equal error variance under the null. Dependence, misspecification, or outcome-driven selection can invalidate that reference. Non-normality also affects calibration. Two-sided and decreasing alternatives require their appropriate tail calculations.
Three practical examples
- Project forecasting: compare residual spread for smaller and larger projects after modeling expected cost, rather than comparing their raw costs.
- Manufacturing analysis: investigate a prespecified increase in regression error variance across an operating-temperature range, while checking for missing curvature.
- AI baseline evaluation: diagnose a classical regression baseline's uncertainty across ordered workload groups before comparing it with a more flexible predictive system.
Think of it this way
Think of testing the precision of the same measuring method on small and large objects. First account for the expected measurement in each group; then compare the scatter of the misses. A group with larger objects naturally has larger readings, but the question concerns its errors, not the readings themselves.
Worked example
Take an original eight-observation example with x = 1 through 8. Let y = 2 + x + e, with e = 1, -1, -1, 1, 3, -3, -3, 3. Thus the observed responses are 4, 3, 4, 7, 10, 5, 6, and 13.
Split after x = 4, retaining all observations. Each group fits an intercept and slope, so each has 4 - 2 = 2 residual degrees of freedom. Within both groups the specified errors sum to zero and are orthogonal to x, so separate least-squares fits each recover intercept 2 and slope 1.
The lower-group squared residuals sum to 4; the higher-group sum is 36. Their residual mean squares are 4/2 = 2 and 36/2 = 18. Therefore F = 18/2 = 9, with numerator and denominator degrees of freedom both equal to two.
For the prespecified increasing alternative, the classical F(2,2) upper-tail probability at nine is 1/(1 + 9) = 0.10. Independent least-squares calculations confirm both sums and the ratio. Despite a ninefold variance estimate, this small example does not reject at 5% under that reference model. The example demonstrates how very limited degrees of freedom affect evidence; the constructed observations are not a real inferential study.
Illustrative case study
In a fictional service company, analysts suspect that larger jobs have less predictable completion times. They order records by job size, choose a split in advance, and fit the same duration regression in each group.
They examine the Goldfeld - Quandt result alongside residual plots, job-type composition, and repeated observations from the same crews. Because crew dependence could invalidate the simple independent-error calculation, they reassess the inference using a suitable approach before changing scheduling buffers. This fictional case illustrates a diagnostic workflow, without claiming that one test establishes the cause or business impact of variable errors.
Common misconceptions and mistakes
Common mistakes include dividing unadjusted squared-error sums when the groups have different residual degrees of freedom, sorting only the predictor while leaving outcomes in their original order, and choosing the most significant split after trying many possibilities.
Dropping central observations may increase contrast between the extremes but also discards information and reduces degrees of freedom. It is not a universally beneficial requirement.
A nonsignificant result does not establish equal variance everywhere. A significant result also does not automatically establish biased regression coefficients or justify a particular weighting scheme. First assess the mean model and sampling structure, then choose a remedy matched to the problem.
Business use
Use the test when an ordered spread comparison is meaningful and the regression assumptions are defensible. Report the ordering variable, retained group sizes, omitted observations, residual degrees of freedom, variance ratio, and test direction. Explain the decision consequence, such as revising uncertainty estimates, instead of treating rejection as a complete model-quality verdict.
People also ask
Must central observations be removed?
No. Some formulations allow them to be retained.
Is it a test of coefficient equality?
No. Its target is error variance, using separately fitted regressions.
Does a large ratio guarantee significance?
No. The reference distribution and residual degrees of freedom matter.
Check your understanding
Answer: Two groups have squared-error sums of 20 and 40, but residual degrees of freedom of 10 and 20.
What is their residual variance ratio?
Answer: Both estimates equal two, so the ratio is one. Comparing squared-error sums alone would misleadingly suggest a twofold difference.
Related terms
- Residual variance
- F distribution
- Degrees of freedom
- Glejser test
- Weighted least squares
- Heteroscedasticity
- Breusch-Pagan test
Learn next
Learn residual mean squares and F tests, then compare ordered-group diagnostics with auxiliary-regression tests. Examine how split choices, dependence, and mean misspecification change the validity of conclusions.
More in Statistics and probability
- Gini's mean difference - Gini’s mean difference is a measure of dispersion defined as the average absolute difference between pairs of observations.
- Global calibration - Global calibration, in the computer-experiment sense used by the NIST engineering-statistics glossary, means developing a function that transforms a...
- Gold standard - A gold standard is an accepted reference used to judge the correctness or quality of another result.
- Gompertz distribution - The Gompertz distribution is a continuous distribution for nonnegative event times whose hazard changes exponentially with time.
- Goodman and Kruskal's gamma - Goodman and Kruskal's gamma is a measure of ordinal association based on concordant and discordant pairs of observations.
- Goodnessoffit test - A goodness-of-fit test evaluates whether observed data are sufficiently inconsistent with a specified statistical model to provide evidence against it.
Sources
lmtest authors, gqtest documentation: https://search.r-project.org/CRAN/refmans/lmtest/html/gqtest.html — primary implementation description, ordering, alternatives, and central omission. statsmodels, het_goldfeldquandt documentation: https://www.statsmodels.org/stable/generated/statsmodels.stats.diagnostic.het_goldfeldquandt.html — primary subsample-test interface. Implementations can use different split and omission conventions. The worked example independently calculates the classical variance ratio and uses equal residual degrees of freedom.
Previous: Golden-section search Next: Golomb coding