class_docstr: Fit a regression model using quadratic inference functions (QIF).
  
  QIF is an alternative to GEE that can be more efficient, and that
  offers different approaches for model selection and inference.
  
  Parameters
  ----------
  endog : array_like
      The dependent variables of the regression.
  exog : array_like
      The independent variables of the regression.
  groups : array_like
      Labels indicating which group each observation belongs to.
      Observations in different groups should be independent.
  family : genmod family
      An instance of a GLM family.
  cov_struct : QIFCovariance instance
      An instance of a QIFCovariance.
  
  References
  ----------
  A. Qu, B. Lindsay, B. Li (2000).  Improving Generalized Estimating
  Equations using Quadratic Inference Functions, Biometrika 87:4.
  www.jstor.org/stable/2673612
docstr: Create a QIF model instance from a formula and dataframe.
  
  Parameters
  ----------
  formula : str or generic Formula object
      The formula specifying the model
  groups : array_like or string
      Array of grouping labels.  If a string, this is the name
      of a variable in `data` that contains the grouping labels.
  data : array_like
      The data for the model.
  subset : array_like
      An array_like object of booleans, integers, or index
      values that indicate the subset of the data to used when
      fitting the model.
  
  Returns
  -------
  model : QIF model instance
docstr_tok: ["Create","a","QIF","model","instance","from","a","formula","and","dataframe",".","Parameters","--","--","--","--","--","formula",":","str","or","generic","Formula","object","The","formula","specifying","the","model","groups",":","array_like","or","string","Array","of","grouping","labels",".","If","a","string",",","this","is","the","name","of","a","variable","in","`","data","`","that","contains","the","grouping","labels",".","data",":","array_like","The","data","for","the","model",".","subset",":","array_like","An","array_like","object","of","booleans",",","integers",",","or","index","values","that","indicate","the","subset","of","the","data","to","used","when","fitting","the","model",".","Returns","--","--","--","-","model",":","QIF","model","instance"]
code: def from_formula(
      cls, formula, groups, data, subset=None, *args, **kwargs
  ):
      """
      Create a QIF model instance from a formula and dataframe.
  
      Parameters
      ----------
      formula : str or generic Formula object
          The formula specifying the model
      groups : array_like or string
          Array of grouping labels.  If a string, this is the name
          of a variable in `data` that contains the grouping labels.
      data : array_like
          The data for the model.
      subset : array_like
          An array_like object of booleans, integers, or index
          values that indicate the subset of the data to used when
          fitting the model.
  
      Returns
      -------
      model : QIF model instance
      """
  
      if isinstance(groups, str):
          groups = data[groups]
  
      model = super().from_formula(
          formula,
          data=data,
          subset=subset,
          groups=groups,
          *args,
          **kwargs,
      )
  
      return model
  
imports: import numpy
  from collections import defaultdict
  import statsmodels.base.model
  from statsmodels.genmod import families
  from statsmodels.genmod.generalized_linear_model import GLM
  from statsmodels.genmod.families import links
  from statsmodels.genmod.families import varfuncs
  import statsmodels.regression.linear_model
  import statsmodels.base.wrapper
  from statsmodels.tools.decorators import cache_readonly
label_desc: Use image node_id 5 for calling the QIF obj's underlying member method code with example usage: obj.from_formula(cls, formula, groups, data, subset) and returns: model