class_docstr: Class to contain results of fitting a linear mixed effects model.
  
  MixedLMResults inherits from statsmodels.LikelihoodModelResults
  
  Parameters
  ----------
  See statsmodels.LikelihoodModelResults
  
  Attributes
  ----------
  model : class instance
      Pointer to MixedLM model instance that called fit.
  normalized_cov_params : ndarray
      The sampling covariance matrix of the estimates
  params : ndarray
      A packed parameter vector for the profile parameterization.
      The first `k_fe` elements are the estimated fixed effects
      coefficients.  The remaining elements are the estimated
      variance parameters.  The variance parameters are all divided
      by `scale` and are not the variance parameters shown
      in the summary.
  fe_params : ndarray
      The fitted fixed-effects coefficients
  cov_re : ndarray
      The fitted random-effects covariance matrix
  bse_fe : ndarray
      The standard errors of the fitted fixed effects coefficients
  bse_re : ndarray
      The standard errors of the fitted random effects covariance
      matrix and variance components.  The first `k_re * (k_re + 1)`
      parameters are the standard errors for the lower triangle of
      `cov_re`, the remaining elements are the standard errors for
      the variance components.
  
  See Also
  --------
  statsmodels.LikelihoodModelResults
class_docstr_tok: ["Class","to","contain","results","of","fitting","a","linear","mixed","effects","model",".","MixedLMResults","inherits","from","statsmodels.LikelihoodModelResults","Parameters","--","--","--","--","--","See","statsmodels.LikelihoodModelResults","Attributes","--","--","--","--","--","model",":","class","instance","Pointer","to","MixedLM","model","instance","that","called","fit",".","normalized_cov_params",":","ndarray","The","sampling","covariance","matrix","of","the","estimates","params",":","ndarray","A","packed","parameter","vector","for","the","profile","parameterization",".","The","first","`","k_fe","`","elements","are","the","estimated","fixed","effects","coefficients",".","The","remaining","elements","are","the","estimated","variance","parameters",".","The","variance","parameters","are","all","divided","by","`","scale","`","and","are","not","the","variance","parameters","shown","in","the","summary",".","fe_params",":","ndarray","The","fitted","fixed-effects","coefficients","cov_re",":","ndarray","The","fitted","random-effects","covariance","matrix","bse_fe",":","ndarray","The","standard","errors","of","the","fitted","fixed","effects","coefficients","bse_re",":","ndarray","The","standard","errors","of","the","fitted","random","effects","covariance","matrix","and","variance","components",".","The","first","`","k_re","*","(","k_re","+","1",")","`","parameters","are","the","standard","errors","for","the","lower","triangle","of","`","cov_re","`",",","the","remaining","elements","are","the","standard","errors","for","the","variance","components",".","See","Also","--","--","--","--","statsmodels.LikelihoodModelResults"]
docstr: The conditional means of random effects given the data.
  
  Returns
  -------
  random_effects : dict
      A dictionary mapping the distinct `group` values to the
      conditional means of the random effects for the group
      given the data.
docstr_tok: ["The","conditional","means","of","random","effects","given","the","data",".","Returns","--","--","--","-","random_effects",":","dict","A","dictionary","mapping","the","distinct","`","group","`","values","to","the","conditional","means","of","the","random","effects","for","the","group","given","the","data","."]
code: def random_effects(self):
      """
      The conditional means of random effects given the data.
  
      Returns
      -------
      random_effects : dict
          A dictionary mapping the distinct `group` values to the
          conditional means of the random effects for the group
          given the data.
      """
      try:
          cov_re_inv = np.linalg.inv(self.cov_re)
      except np.linalg.LinAlgError:
          raise ValueError(
              "Cannot predict random effects from "
              + "singular covariance structure."
          )
  
      vcomp = self.vcomp
      k_re = self.k_re
  
      ranef_dict = {}
      for group_ix, group in enumerate(self.model.group_labels):
          endog = self.model.endog_li[group_ix]
          exog = self.model.exog_li[group_ix]
          ex_r = self.model._aex_r[group_ix]
          ex2_r = self.model._aex_r2[group_ix]
          vc_var = self.model._expand_vcomp(vcomp, group_ix)
  
          # Get the residuals relative to fixed effects
          resid = endog
          if self.k_fe > 0:
              expval = np.dot(exog, self.fe_params)
              resid = resid - expval
  
          solver = _smw_solver(
              self.scale, ex_r, ex2_r, cov_re_inv, 1 / vc_var
          )
          vir = solver(resid)
  
          xtvir = _dot(ex_r.T, vir)
  
          xtvir[0:k_re] = np.dot(self.cov_re, xtvir[0:k_re])
          xtvir[k_re:] *= vc_var
          ranef_dict[group] = pd.Series(
              xtvir, index=self._expand_re_names(group_ix)
          )
  
      return ranef_dict
  
imports: import warnings
  import numpy
  import pandas
  import patsy
  from scipy import sparse
  from scipy.stats.distributions import norm
  from statsmodels.base._penalties import Penalty
  import statsmodels.base.model
  from statsmodels.tools import data
  from statsmodels.tools.decorators import cache_readonly
  from statsmodels.tools.sm_exceptions import ConvergenceWarning
label_desc: Use image node_id 7 for calling the MixedLMResults obj's underlying member method code with example usage: obj.random_effects() and returns: ranef_dict