class_docstr: Fit a conditional multinomial logit model to grouped data.
  
  Parameters
  ----------
  endog : array_like
      The dependent variable, must be integer-valued, coded
      0, 1, ..., c-1, where c is the number of response
      categories.
  exog : array_like
      The independent variables.
  groups : array_like
      Codes defining the groups. This is a required keyword parameter.
  
  Notes
  -----
  Equivalent to femlogit in Stata.
  
  References
  ----------
  Gary Chamberlain (1980).  Analysis of covariance with qualitative
  data. The Review of Economic Studies.  Vol. 47, No. 1, pp. 225-238.
class_docstr_tok: ["Fit","a","conditional","multinomial","logit","model","to","grouped","data",".","Parameters","--","--","--","--","--","endog",":","array_like","The","dependent","variable",",","must","be","integer-valued",",","coded","0",",","1",",","...",",","c-1",",","where","c","is","the","number","of","response","categories",".","exog",":","array_like","The","independent","variables",".","groups",":","array_like","Codes","defining","the","groups",".","This","is","a","required","keyword","parameter",".","Notes","--","--","-","Equivalent","to","femlogit","in","Stata",".","References","--","--","--","--","--","Gary","Chamberlain","(","1980",")",".","Analysis","of","covariance","with","qualitative","data",".","The","Review","of","Economic","Studies",".","Vol",".","47",",","No",".","1",",","pp",".","225-238","."]
code: def loglike(self, params):
      q = self.exog.shape[1]
      c = self.k_cat - 1
  
      pmat = params.reshape((q, c))
      pmat = np.concatenate((np.zeros((q, 1)), pmat), axis=1)
      lpr = np.dot(self.exog, pmat)
  
      ll = 0.0
      for ii in self._grp_ix:
          x = lpr[ii, :]
          jj = np.arange(x.shape[0], dtype=int)
          y = self.endog[ii]
          denom = 0.0
          for p in itertools.permutations(y):
              denom += np.exp(x[(jj, p)].sum())
          ll += x[(jj, y)].sum() - np.log(denom)
  
      return ll
  
imports: import numpy
  import statsmodels.base.model
  import statsmodels.regression.linear_model
  import statsmodels.base.wrapper
  from statsmodels.discrete.discrete_model import MultinomialResults, MultinomialResultsWrapper
  import collections
  import warnings
  import itertools
label_desc: Use image node_id 3 for calling the ConditionalMNLogit obj's underlying member method code with example usage: obj.loglike(params) and returns: ll