statsmodels.stats.diagnostic.compare_cox

statsmodels.stats.diagnostic.compare_cox(results_x, results_z, store=False)[source]

Compute the Cox test for non-nested models

Parameters:

results_x : Result instance

result instance of first model

results_z : Result instance

result instance of second model

store : bool, default False

If true, then the intermediate results are returned.

Returns:

tstat : float

t statistic for the test that including the fitted values of the first model in the second model has no effect.

pvalue : float

two-sided pvalue for the t statistic

res_store : ResultsStore, optional

Intermediate results. Returned if store is True.

Notes

Tests of non-nested hypothesis might not provide unambiguous answers. The test should be performed in both directions and it is possible that both or neither test rejects. see [R84] for more information.

Formulas from [R84], section 8.3.4 translated to code

Matches results for Example 8.3 in Greene

References

[R84](1, 2, 3) Greene, W. H. Econometric Analysis. New Jersey. Prentice Hall; 5th edition. (2002).