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 __init__(self, endog, exog, missing="none", **kwargs):
      super().__init__(endog, exog, missing=missing, **kwargs)
  
      # endog must be integers
      self.endog = self.endog.astype(int)
  
      self.k_cat = self.endog.max() + 1
      self.df_model = (self.k_cat - 1) * self.exog.shape[1]
      self.df_resid = self.nobs - self.df_model
      self._ynames_map = {j: str(j) for j in range(self.k_cat)}
      self.J = self.k_cat  # Unfortunate name, needed for results
      self.K = self.exog.shape[1]  # for compatibility with MNLogit
  
      if self.endog.min() < 0:
          msg = "endog may not contain negative values"
          raise ValueError(msg)
  
      grx = collections.defaultdict(list)
      for k, v in enumerate(self.groups):
          grx[v].append(k)
      self._group_labels = list(grx.keys())
      self._group_labels.sort()
      self._grp_ix = [grx[k] for k in self._group_labels]
  
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 1 to create a new ConditionalMNLogit object from inherited base classes: _ConditionalModel with example: obj = ConditionalMNLogit(endog, exog, missing)