code: def test_cov_oneway(cov_list, nobs_list):
      r"""Multiple sample hypothesis test that covariance matrices are equal.
  
      This is commonly known as Box-M test.
  
      The Null and alternative hypotheses are
  
      .. math::
  
         H0 &: \Sigma_i = \Sigma_j  \text{ for all i and j} \\
         H1 &: \Sigma_i \neq \Sigma_j \text{ for at least one i and j}
  
      where :math:`\Sigma_i` is the covariance of sample `i`.
  
      Parameters
      ----------
      cov_list : list of array_like
          Covariance matrices of the sample, estimated with denominator
          ``(N - 1)``, i.e. `ddof=1`.
      nobs_list : list
          List of the number of observations used in the estimation of the
          covariance for each sample.
  
      Returns
      -------
      res : instance of HolderTuple
          Results contains test statistic and pvalues for both chisquare and F
          distribution based tests, identified by the name ending "_chi2" and
          "_f".
          Attributes ``statistic, pvalue`` refer to the F-test version.
  
      Notes
      -----
      approximations to distribution of test statistic is by Box
  
      References
      ----------
      Rencher, Alvin C., and William F. Christensen. 2012. Methods of
      Multivariate Analysis: Rencher/Methods. Wiley Series in Probability and
      Statistics. Hoboken, NJ, USA: John Wiley & Sons, Inc.
      https://doi.org/10.1002/9781118391686.
  
      StataCorp, L. P. Stata Multivariate Statistics: Reference Manual.
      Stata Press Publication.
      """
      # Note stata uses nobs in cov, this uses nobs - 1
      cov_list = list(map(np.asarray, cov_list))
      m = len(cov_list)
      nobs = sum(nobs_list)  # total number of observations
      k = cov_list[0].shape[0]
  
      cov_pooled = sum(
          (n - 1) * c for (n, c) in zip(nobs_list, cov_list)
      )
      cov_pooled /= nobs - m
      stat0 = (nobs - m) * _logdet(cov_pooled)
      stat0 -= sum(
          (n - 1) * _logdet(c) for (n, c) in zip(nobs_list, cov_list)
      )
  
      # Box's chi2
      c1 = sum(1 / (n - 1) for n in nobs_list) - 1 / (nobs - m)
      c1 *= (2 * k * k + 3 * k - 1) / (6 * (k + 1) * (m - 1))
      df_chi2 = (m - 1) * k * (k + 1) / 2
      statistic_chi2 = (1 - c1) * stat0
      pvalue_chi2 = stats.chi2.sf(statistic_chi2, df_chi2)
  
      c2 = (
          sum(1 / (n - 1) ** 2 for n in nobs_list) - 1 / (nobs - m) ** 2
      )
      c2 *= (k - 1) * (k + 2) / (6 * (m - 1))
      a1 = df_chi2
      a2 = (a1 + 2) / abs(c2 - c1**2)
      b1 = (1 - c1 - a1 / a2) / a1
      b2 = (1 - c1 + 2 / a2) / a2
      if c2 > c1**2:
          statistic_f = b1 * stat0
      else:
          tmp = b2 * stat0
          statistic_f = a2 / a1 * tmp / (1 + tmp)
      df_f = (a1, a2)
      pvalue_f = stats.f.sf(statistic_f, *df_f)
      return HolderTuple(
          statistic=statistic_f,  # name convention, using F here
          pvalue=pvalue_f,  # name convention, using F here
          statistic_base=stat0,
          statistic_chi2=statistic_chi2,
          pvalue_chi2=pvalue_chi2,
          df_chi2=df_chi2,
          distr_chi2="chi2",
          statistic_f=statistic_f,
          pvalue_f=pvalue_f,
          df_f=df_f,
          distr_f="F",
      )
  
file_path: statsmodels/statsmodels/stats/multivariate.py
imports: import numpy
  from scipy import stats
  from statsmodels.stats.moment_helpers import cov2corr
  from statsmodels.stats.base import HolderTuple
  from statsmodels.tools.validation import array_like
label_desc: Use image node_id 11 for calling a global function with example usage: test_cov_oneway(cov_list, nobs_list) and returns: HolderTuple