def linear_harvey_collier(res):
 rr = recursive_olsresiduals(res, skip=3, alpha=0.95)
 from scipy import stats
 return stats.ttest_1samp(rr[3][3:], 0)

def linear_harvey_collier ( res ) : rr = recursive_olsresiduals ( res , skip = 3 , alpha = 0.95 ) from scipy import stats return stats . ttest_1samp ( rr [ 3 ] [ 3 : ] , 0 )
harvey collier test for linearity the null hypothesis is that the regression is correctly modeled as linear .