# ssHeteroskedasticityTest¶

## Purpose¶

Tests the null hypothesis of no heteroskedasticity by comparing the sum-of-squares of the first third of the sample to the sum-of-squares of last third of the sample. Analogous to a Goldfeld-Quandt test.

## Format¶

{ test_statistic, p_value } = ssHeteroskedasticityTest(resid[, alternative])
Parameters
• resid (Vector) – Model residuals.

• alternative (String) – Optional argument, specifies alternative to use for finding critical values. Options include: "increasing", "decreasing", or "two-sided". Default = "two-sided".

Returns
• test_stat (Scalar) – Test statistic for the heteroskedasticity.

• p_value (Scalar) – P-value for the test statistic for the heteroskedasticity.

## Examples¶

// Generate random vector of residuals
rndseed 929212;
resid = rndn(150, 1);

// Test for heteroskedasticity
{ test_stat, p_val } = ssHeteroskedasticityTest(resid);


The code above results in the following:

test_stat = 0.9598
p_val = 0.8854


ssmain.src