code: def simultaneous_ci(q_crit, var, groupnobs, pairindices=None):
      """Compute simultaneous confidence intervals for comparison of means.
  
      q_crit value is generated from tukey hsd test. Variance is considered
      across all groups. Returned halfwidths can be thought of as uncertainty
      intervals around each group mean. They allow for simultaneous
      comparison of pairwise significance among any pairs (by checking for
      overlap)
  
      Parameters
      ----------
      q_crit : float
          The Q critical value studentized range statistic from Tukey's HSD
      var : float
          The group variance
      groupnobs : array_like object
          Number of observations contained in each group.
      pairindices : tuple of lists, optional
          Indices corresponding to the upper triangle of matrix. Computed
          here if not supplied
  
      Returns
      -------
      halfwidths : ndarray
          Half the width of each confidence interval for each group given in
          groupnobs
  
      See Also
      --------
      MultiComparison : statistics class providing significance tests
      tukeyhsd : among other things, computes q_crit value
  
      References
      ----------
      .. [*] Hochberg, Y., and A. C. Tamhane. Multiple Comparison Procedures.
             Hoboken, NJ: John Wiley & Sons, 1987.)
      """
      # Set initial variables
      ng = len(groupnobs)
      if pairindices is None:
          pairindices = np.triu_indices(ng, 1)
  
      # Compute dij for all pairwise comparisons ala hochberg p. 95
      gvar = var / groupnobs
  
      d12 = np.sqrt(gvar[pairindices[0]] + gvar[pairindices[1]])
  
      # Create the full d matrix given all known dij vals
      d = np.zeros((ng, ng))
      d[pairindices] = d12
      d = d + d.conj().T
  
      # Compute the two global sums from hochberg eq 3.32
      sum1 = np.sum(d12)
      sum2 = np.sum(d, axis=0)
  
      if ng > 2:
          w = ((ng - 1.0) * sum2 - sum1) / ((ng - 1.0) * (ng - 2.0))
      else:
          w = sum1 * np.ones((2, 1)) / 2.0
  
      return (q_crit / np.sqrt(2)) * w
  
imports: from collections import namedtuple
  from statsmodels.compat.python import lzip, lrange
  import copy
  import math
  import numpy
  from numpy.testing import assert_almost_equal, assert_equal
  from scipy import stats, interpolate
  from statsmodels.iolib.table import SimpleTable
  from statsmodels.stats.multitest import multipletests, _ecdf, fdrcorrection, fdrcorrection_twostage
  from statsmodels.graphics import utils
  from statsmodels.tools.sm_exceptions import ValueWarning
label_desc: Use image node_id 21 for calling a global function with example usage: simultaneous_ci(q_crit, var, groupnobs, pairindices) and returns: unknown