'use F test to test whether restricted model is correct
Parameters
restricted : Result instance
The restricted model is assumed to be nested in the
current model. The result instance of the restricted model
is required to have two attributes, residual sum of
squares, `ssr`, residual degrees of freedom, `df_resid`.
Returns
f_value : float
test statistic, F distributed
p_value : float
p-value of the test statistic
df_diff : int
degrees of freedom of the restriction, i.e. difference in
df between models
Notes
See mailing list discussion October 17,
This test compares the residual sum of squares of the two
models.  This is not a valid test, if there is unspecified
heteroscedasticity or correlation. This method will issue a
warning if this is detected but still return the results under
the assumption of homoscedasticity and no autocorrelation
(sphericity).'

def compare_f_test(self, restricted):

    has_robust1 = (getattr(self, 'cov_type', 'nonrobust') != 'nonrobust')
    has_robust2 = (getattr(restricted, 'cov_type', 'nonrobust') != 'nonrobust')
    if (has_robust1 or has_robust2):
        warnings.warn(('F    test    for    comparison    is    likely    invalid    with    ' + 'robust    covariance,    proceeding    anyway'), InvalidTestWarning)
    ssr_full = self.ssr
    ssr_restr = restricted.ssr
    df_full = self.df_resid
    df_restr = restricted.df_resid
    df_diff = (df_restr - df_full)
    f_value = ((((ssr_restr - ssr_full) / df_diff) / ssr_full) * df_full)
    p_value = stats.f.sf(f_value, df_diff, df_full)
    return (f_value, p_value, df_diff)
