'estimate the model and compute the Anova table
Returns
AnovaResults instance'

def fit(self):

    y = self.data[self.depvar].values
    within = [('C(%s,    Sum)' % i) for i in self.within]
    subject = ('C(%s,    Sum)' % self.subject)
    factors = (within + [subject])
    x = patsy.dmatrix('*'.join(factors), data=self.data)
    term_slices = x.design_info.term_name_slices
    for key in term_slices:
        ind = np.array(([False] * x.shape[1]))
        ind[term_slices[key]] = True
        term_slices[key] = np.array(ind)
    term_exclude = [':'.join(factors)]
    ind = _not_slice(term_slices, term_exclude, x.shape[1])
    x = x[:, ind]
    model = OLS(y, x)
    results = model.fit()
    if (model.rank < x.shape[1]):
        raise ValueError('Independent    variables    are    collinear.')
    for i in term_exclude:
        term_slices.pop(i)
    for key in term_slices:
        term_slices[key] = term_slices[key][ind]
    params = results.params
    df_resid = results.df_resid
    ssr = results.ssr
    anova_table = pd.DataFrame({'F    Value': [], 'Num    DF': [], 'Den    DF': [], 'Pr    >    F': []})
    for key in term_slices:
        if ((self.subject not in key) and (key != 'Intercept')):
            (ssr1, df_resid1) = _ssr_reduced_model(y, x, term_slices, params, [key])
            df1 = (df_resid1 - df_resid)
            msm = ((ssr1 - ssr) / df1)
            if ((key == ':'.join(factors[:(-1)])) or (((key + ':') + subject) not in term_slices)):
                mse = (ssr / df_resid)
                df2 = df_resid
            else:
                (ssr1, df_resid1) = _ssr_reduced_model(y, x, term_slices, params, [((key + ':') + subject)])
                df2 = (df_resid1 - df_resid)
                mse = ((ssr1 - ssr) / df2)
            F = (msm / mse)
            p = stats.f.sf(F, df1, df2)
            term = key.replace('C(', '').replace(',    Sum)', '')
            anova_table.loc[(term, 'F    Value')] = F
            anova_table.loc[(term, 'Num    DF')] = df1
            anova_table.loc[(term, 'Den    DF')] = df2
            anova_table.loc[(term, 'Pr    >    F')] = p
    return AnovaResults(anova_table.iloc[:, [1, 2, 0, 3]])
