statsmodels.stats.diagnostic.linear_harvey_collier

statsmodels.stats.diagnostic.linear_harvey_collier(res, order_by=None, skip=None)[source]

Harvey Collier test for linearity

The Null hypothesis is that the regression is correctly modeled as linear.

Parameters:
resRegressionResults

A results instance from a linear regression.

order_byarray_like, default None

Integer array specifying the order of the residuals. If not provided, the order of the residuals is not changed. If provided, must have the same number of observations as the endogenous variable.

skipint, default None

The number of observations to use for initial OLS, if None then skip is set equal to the number of regressors (columns in exog).

Returns:
tvaluefloat

The test statistic, based on ttest_1sample.

pvaluefloat

The pvalue of the test.

See also

statsmodels.stats.diadnostic.recursive_olsresiduals

Recursive OLS residual calculation used in the test.

Notes

This test is a t-test that the mean of the recursive ols residuals is zero. Calculating the recursive residuals might take some time for large samples.


Last update: Oct 29, 2024