class_docstr: Results class for pairwise comparisons, based on p-values
  
  Parameters
  ----------
  pvals_raw : array_like, 1-D
      p-values from a pairwise comparison test
  all_pairs : list of tuples
      list of indices, one pair for each comparison
  multitest_method : str
      method that is used by default for p-value correction. This is used
      as default by the methods like if the multiple-testing method is not
      specified as argument.
  levels : {list[str], None}
      optional names of the levels or groups
  n_levels : None or int
      If None, then the number of levels or groups is inferred from the
      other arguments. It can be explicitly specified, if the inferred
      number is incorrect.
  
  Notes
  -----
  This class can also be used for other pairwise comparisons, for example
  comparing several treatments to a control (as in Dunnet's test).
code: def __init__(
      self,
      pvals_raw,
      all_pairs,
      multitest_method="hs",
      levels=None,
      n_levels=None,
  ):
      self.pvals_raw = pvals_raw
      self.all_pairs = all_pairs
      if n_levels is None:
          # for all_pairs nobs*(nobs-1)/2
          self.n_levels = np.max(all_pairs) + 1
      else:
          self.n_levels = n_levels
  
      self.multitest_method = multitest_method
      self.levels = levels
      if levels is None:
          self.all_pairs_names = [f"{pairs}" for pairs in all_pairs]
      else:
          self.all_pairs_names = [
              f"{levels[pairs[0]]}-{levels[pairs[1]]}"
              for pairs in all_pairs
          ]
  
file_path: statsmodels/statsmodels/stats/base.py
imports: from statsmodels.compat.python import lzip
  import numpy
  from statsmodels.tools.testing import Holder
label_desc: Use image node_id 1 to create a new AllPairsResults object  with example: obj = AllPairsResults(pvals_raw, all_pairs, multitest_method, levels, n_levels)