class_docstr: Class for results of tests of linear restrictions on coefficients in a model.
  
  This class functions mainly as a container for `t_test`, `f_test` and
  `wald_test` for the parameters of a model.
  
  The attributes depend on the statistical test and are either based on the
  normal, the t, the F or the chisquare distribution.
class_docstr_tok: ["Class","for","results","of","tests","of","linear","restrictions","on","coefficients","in","a","model",".","This","class","functions","mainly","as","a","container","for","`","t_test","`",",","`","f_test","`","and","`","wald_test","`","for","the","parameters","of","a","model",".","The","attributes","depend","on","the","statistical","test","and","are","either","based","on","the","normal",",","the","t",",","the","F","or","the","chisquare","distribution","."]
code: def __init__(
      self,
      t=None,
      F=None,
      sd=None,
      effect=None,
      df_denom=None,
      df_num=None,
      alpha=0.05,
      **kwds,
  ):
      self.effect = effect  # Let it be None for F
      if F is not None:
          self.distribution = "F"
          self.fvalue = F
          self.statistic = self.fvalue
          self.df_denom = df_denom
          self.df_num = df_num
          self.dist = fdist
          self.dist_args = (df_num, df_denom)
          self.pvalue = fdist.sf(F, df_num, df_denom)
      elif t is not None:
          self.distribution = "t"
          self.tvalue = t
          self.statistic = t  # generic alias
          self.sd = sd
          self.df_denom = df_denom
          self.dist = student_t
          self.dist_args = (df_denom,)
          self.pvalue = self.dist.sf(np.abs(t), df_denom) * 2
      elif "statistic" in kwds:
          # TODO: currently targeted to normal distribution, and chi2
          self.distribution = kwds["distribution"]
          self.statistic = kwds["statistic"]
          self.tvalue = value = kwds["statistic"]  # keep alias
          # TODO: for results instance we decided to use tvalues also for normal
          self.sd = sd
          self.dist = getattr(stats, self.distribution)
          self.dist_args = kwds.get("dist_args", ())
          if self.distribution == "chi2":
              self.pvalue = self.dist.sf(self.statistic, df_denom)
              self.df_denom = df_denom
          else:
              "normal"
              self.pvalue = np.full_like(value, np.nan)
              not_nan = ~np.isnan(value)
              self.pvalue[not_nan] = (
                  self.dist.sf(np.abs(value[not_nan])) * 2
              )
      else:
          self.pvalue = np.nan
  
      # cleanup
      # should we return python scalar?
      self.pvalue = np.squeeze(self.pvalue)
  
      if self.effect is not None:
          self.c_names = ["c%d" % ii for ii in range(len(self.effect))]
      else:
          self.c_names = None
  
imports: import numpy
  from scipy.stats import f
  from scipy.stats import t
  from scipy import stats
  from statsmodels.tools.tools import clean0, fullrank
  from statsmodels.stats.multitest import multipletests
label_desc: Use image node_id 1 to create a new ContrastResults object  with example: obj = ContrastResults(t, F, sd, effect, df_denom, df_num, alpha)