Goldfeld-Quandt Test Calculator

Inputs

Goldfeld-Quandt F statistic1.65
p-value0.1013
Numerator df (group 2)28
Denominator df (group 1)26
How this was calculated
  1. Inputs: low-variance group RSS 180.00 on 30 observations, high-variance group RSS 320.00 on 32, 4 fitted parameters per regression.
  2. Residual variances: group 1 6.923 and group 2 11.429 after dividing by their degrees of freedom.
  3. F = 11.429 / 6.923 = 1.65 on (28, 26) degrees of freedom.
  4. The p-value is 0.1013: no significant difference in error variance between the groups at the 5% level.

Before heteroskedasticity tests learned to regress squared residuals, Goldfeld and Quandt (1965) proposed the direct approach: order the sample by the variable you suspect drives the variance, split it into a low group and a high group, and compare the two residual variances as an F ratio. This calculator takes each group's residual sum of squares, both sample sizes and the parameter count, and returns the F statistic with its exact p-value.

Worked examples

Variance gap, not significant

(180 · 30 · 320 · 32 · 4)

Goldfeld-Quandt F statistic1.65
p-value0.1013
Numerator df (group 2)28
Denominator df (group 1)26

Significant variance gap

(95 · 25 · 210 · 25 · 3)

Goldfeld-Quandt F statistic2.21
p-value0.0347
Numerator df (group 2)22
Denominator df (group 1)22

Equal variances

(420 · 50 · 430 · 48 · 5)

Goldfeld-Quandt F statistic1.07
p-value0.4091
Numerator df (group 2)43
Denominator df (group 1)45

Sorting, splitting and dropping the middle

The procedure has three steps, each with a purpose. Sorting by the suspect variable - income for household spending, size for firm data, time for a growing series - arranges the sample so that any variance gradient becomes a difference between the ends. Splitting into two groups converts the gradient into two measurable variances. Dropping the central observations, often a fifth to a third of the sample, sharpens the contrast: the borderline cases in the middle dilute the difference the test is trying to see.

Each group's regression is fitted separately and its RSS divided by its own degrees of freedom, n - k, before the ratio is taken. That division is what makes the statistic an honest F: unequal group sizes and the parameters spent in each fit are accounted for exactly, as the worked examples show - in the first, group sizes of 30 and 32 with 4 parameters leave 26 and 28 degrees of freedom.

  • Order by the variable suspected of driving the variance
  • Fit each group separately; compare RSS/(n - k) as an F ratio
  • Dropping central observations sharpens the contrast
  • One-sided by construction: the high-variance group goes on top

Building the F ratio

The statistic is F = [RSS_2/(n_2 - k)] / [RSS_1/(n_1 - k)], with the group believed to have the larger variance in the numerator, and it is compared with an F distribution on (n_2 - k, n_1 - k) degrees of freedom. In the first worked example the residual variances are 11.429 and 6.923, giving F = 1.65 on (28, 26) degrees of freedom and p = 0.1013 - a variance ratio that looks large in raw terms but is within what samples of this size produce by chance.

The second example makes the same point from the other side: a ratio of 2.21 on (22, 22) degrees of freedom reaches p = 0.0347 and is significant, because equal, moderately sized groups pin the variances down more tightly. The third example's near-identical group RSS values give F = 1.07, p = 0.4091 - nothing. The lesson generalises: this test's verdicts are as much about group sizes as about the variance gap.

ExampleGroup 1 varianceGroup 2 varianceFp
16.92311.4291.650.1013
24.3189.5452.210.0347
39.33310.0001.070.4091

Worked examples

Example 1: Group 1 RSS (low variance) 180; Group 1 observations 30; Group 2 RSS (high variance) 320; Group 2 observations 32; Parameters per regression (k) 4. Goldfeld-Quandt F statistic = 1.65. Supporting values: p-value 0.1013; Numerator df (group 2) 28; Denominator df (group 1) 26. Inputs: low-variance group RSS 180.00 on 30 observations, high-variance group RSS 320.00 on 32, 4 fitted parameters per regression. Residual variances: group 1 6.923 and group 2 11.429 after dividing by their degrees of freedom. F = 11.429 / 6.923 = 1.65 on (28, 26) degrees of freedom. The p-value is 0.1013: no significant difference in error variance between the groups at the 5% level.

Example 2: Group 1 RSS (low variance) 95; Group 1 observations 25; Group 2 RSS (high variance) 210; Group 2 observations 25; Parameters per regression (k) 3. Goldfeld-Quandt F statistic = 2.21. Supporting values: p-value 0.0347; Numerator df (group 2) 22; Denominator df (group 1) 22. Inputs: low-variance group RSS 95.00 on 25 observations, high-variance group RSS 210.00 on 25, 3 fitted parameters per regression. Residual variances: group 1 4.318 and group 2 9.545 after dividing by their degrees of freedom. F = 9.545 / 4.318 = 2.21 on (22, 22) degrees of freedom. The p-value is 0.0347: the error variance differs significantly between the two groups.

Example 3: Group 1 RSS (low variance) 420; Group 1 observations 50; Group 2 RSS (high variance) 430; Group 2 observations 48; Parameters per regression (k) 5. Goldfeld-Quandt F statistic = 1.07. Supporting values: p-value 0.4091; Numerator df (group 2) 43; Denominator df (group 1) 45. Inputs: low-variance group RSS 420.00 on 50 observations, high-variance group RSS 430.00 on 48, 5 fitted parameters per regression. Residual variances: group 1 9.333 and group 2 10.000 after dividing by their degrees of freedom. F = 10.000 / 9.333 = 1.07 on (43, 45) degrees of freedom. The p-value is 0.4091: no significant difference in error variance between the groups at the 5% level.

Choosing the ordering variable

The test stands or falls on the ordering variable, because it can only find variance that grows along that variable. The right choice is economic, not statistical: the scale variable of the data-generating process. Household expenditure surveys order by income; firm-level production data by output or employment; time series by time itself when the suspicion is a variance that grows with the level of the series. Ordering by a variable unrelated to the variance mechanism produces two groups with the same variance and a guaranteed null result that means nothing.

If several variables are candidates, the test can be run once per candidate - but each run is a fresh look at the data, and a trawl through many orderings will manufacture significance. Nominate the ordering variable from theory first, as the test's designers assumed, and treat extra orderings as exploration rather than evidence.

Goldfeld-Quandt vs White and Breusch-Pagan

The residual-regression tests - White and Breusch-Pagan - need no ordering variable and detect variance patterns of any shape, which is why they dominate modern practice. Goldfeld-Quandt survives because its weakness is also a strength: by committing to one ordering variable and one split, it spends its degrees of freedom on a single sharp comparison, and when the variance truly is monotone in that variable it is often the most powerful of the three.

Its second survival niche is transparency. The two group variances are themselves informative numbers - a variance that triples from the smallest to the largest firms is a finding, not just a test result - and the F ratio reports them in a form any reader can recompute from the two RSS values. Modern robust standard errors have retired all three tests from their gatekeeping role, but as descriptions of how variance behaves across a sample, the group comparison remains hard to beat.

Practical notes

Enter the RSS from each group's own regression, not from a pooled fit - the pooled residuals mix the two variances the test exists to separate. The parameter count k must be the number fitted in each group's regression, and it is subtracted from both group sizes, so groups must each be comfortably larger than k for the test to have degrees of freedom worth having.

The p-value returned is the upper tail of the F distribution, matching the test's one-sided design: the numerator group is the one suspected of larger variance. If the data surprise you and the supposed low group has the bigger variance, the honest report is the reversed ratio as a new test - not a doubled p-value on the original.

The dropped middle deserves a word of defence, since it is the step newcomers most often skip as wasteful. The observations nearest the split are the ones whose variance regime is most ambiguous; including them assigns genuinely middle-variance data to one pole or the other and dilutes both group estimates toward each other. Dropping a central band trades sample size for contrast, and at the moderate sample sizes where this test is used the trade usually pays. The worked examples keep the groups contiguous for transparency, but the classical procedure's gap is a considered choice, not an oversight.

There is a quiet modern echo of the test in machine-learning practice: comparing residual variance across slices of a prediction - by geography, by customer segment, by score band - to find where a model is unreliable. That is Goldfeld-Quandt's logic with the ordering variable generalised, and it inherits the same discipline: nominate the slices from a hypothesis about where the model strains, not from a search for the slice that looks worst, or the comparison reports the search rather than the model.

The test's assumptions deserve the same explicitness as its arithmetic. It presumes normal errors within each group - the F distribution for a variance ratio is even more sensitive to kurtosis than most - and it presumes the two regressions are correctly specified, since a functional-form error concentrated in one group masquerades as that group's larger variance. Neither presumption is testable within the procedure itself. That is the honest boundary of a 1965 instrument: exact, transparent, and dependent on the analyst for the judgements - ordering variable, split point, specification - that its output cannot validate.

FAQs

What F statistic does the first example give?

The group variances are 11.429 and 6.923 after dividing by their degrees of freedom, so F = 1.65 on (28, 26) degrees of freedom.

What p-value does the second example give?

Its p-value is 0.0347 - the variance difference is significant at the 5% level.

What F does the second example produce?

It produces F = 2.21, from group RSS values of 210 and 95 on equal groups of 25.

What F does the balanced third example give?

It gives F = 1.07 with p = 0.4091: the two groups' residual variances are effectively the same.

How many numerator degrees of freedom does the first example have?

It has 28 - the high group's 32 observations minus the 4 fitted parameters.

What high-group RSS does the first example use?

The high-variance group's RSS is 320, against 180 for the low-variance group.

Sources

Related calculators

Breusch-Pagan Test Calculator
The Breusch-Pagan heteroskedasticity test: LM statistic from n and the auxiliary R-squared, with the chi-square p-value and the 5% verdict.
White Test Calculator
White's general heteroskedasticity test: the nR-squared Lagrange multiplier statistic and chi-square p-value from the auxiliary regression of squared residuals.
Bartlett's Test Calculator
Bartlett's test for homogeneity of variance across three groups from group sizes and variances, with the pooled variance, Bartlett correction factor and the exact chi-square p-value at 2 degrees of freedom.