'Summarize the mixed model regression results.
Parameters
yname : string, optional
Default is `y`
xname_fe : list of strings, optional
Fixed effects covariate names
xname_re : list of strings, optional
Random effects covariate names
title : string, optional
Title for the top table. If not None, then this replaces
the default title
alpha : float
significance level for the confidence intervals
Returns
smry : Summary instance
this holds the summary tables and text, which can be
printed or converted to various output formats.
See Also
statsmodels.iolib.summary.Summary : class to hold summary
results'

def summary(self, yname=None, xname_fe=None, xname_re=None, title=None, alpha=0.05):

    from statsmodels.iolib import summary2
    smry = summary2.Summary()
    info = OrderedDict()
    info['Model:'] = 'MixedLM'
    if (yname is None):
        yname = self.model.endog_names
    info['No.    Observations:'] = str(self.model.n_totobs)
    info['No.    Groups:'] = str(self.model.n_groups)
    gs = np.array([len(x) for x in self.model.endog_li])
    info['Min.    group    size:'] = ('%.0f' % min(gs))
    info['Max.    group    size:'] = ('%.0f' % max(gs))
    info['Mean    group    size:'] = ('%.1f' % np.mean(gs))
    info['Dependent    Variable:'] = yname
    info['Method:'] = self.method
    info['Scale:'] = self.scale
    info['Likelihood:'] = self.llf
    info['Converged:'] = ('Yes' if self.converged else 'No')
    smry.add_dict(info)
    smry.add_title('Mixed    Linear    Model    Regression    Results')
    float_fmt = '%.3f'
    sdf = (np.nan * np.ones((((self.k_fe + self.k_re2) + self.k_vc), 6)))
    sdf[0:self.k_fe, 0] = self.fe_params
    sdf[0:self.k_fe, 1] = np.sqrt(np.diag(self.cov_params()[0:self.k_fe]))
    sdf[0:self.k_fe, 2] = (sdf[0:self.k_fe, 0] / sdf[0:self.k_fe, 1])
    sdf[0:self.k_fe, 3] = (2 * norm.cdf((- np.abs(sdf[0:self.k_fe, 2]))))
    qm = (- norm.ppf((alpha / 2)))
    sdf[0:self.k_fe, 4] = (sdf[0:self.k_fe, 0] - (qm * sdf[0:self.k_fe, 1]))
    sdf[0:self.k_fe, 5] = (sdf[0:self.k_fe, 0] + (qm * sdf[0:self.k_fe, 1]))
    jj = self.k_fe
    for i in range(self.k_re):
        for j in range((i + 1)):
            sdf[(jj, 0)] = self.cov_re[(i, j)]
            sdf[(jj, 1)] = (np.sqrt(self.scale) * self.bse[jj])
            jj += 1
    for i in range(self.k_vc):
        sdf[(jj, 0)] = self.vcomp[i]
        sdf[(jj, 1)] = (np.sqrt(self.scale) * self.bse[jj])
        jj += 1
    sdf = pd.DataFrame(index=self.model.data.param_names, data=sdf)
    sdf.columns = ['Coef.', 'Std.Err.', 'z', 'P>|z|', ('[' + str((alpha / 2))), (str((1 - (alpha / 2))) + ']')]
    for col in sdf.columns:
        sdf[col] = [((float_fmt % x) if np.isfinite(x) else '') for x in sdf[col]]
    smry.add_df(sdf, align='r')
    return smry
