code: def test_ols_noncentrality(self):
      k = self.k_groups
  
      res_ols = OLS(self.y, self.ex).fit()
      nobs_t = res_ols.model.nobs
  
      # constraint
      c_equal = -np.eye(k)[1:]
      c_equal[:, 0] = 1
      v = np.zeros(c_equal.shape[0])
  
      # noncentrality at estimated parameters
      wt = res_ols.wald_test(c_equal, scalar=True)
      df_num, df_denom = wt.df_num, wt.df_denom
  
      cov_p = res_ols.cov_params()
  
      nc_wt = wald_test_noncent_generic(
          res_ols.params, c_equal, v, cov_p, diff=None, joint=True
      )
      assert_allclose(nc_wt, wt.statistic * wt.df_num, rtol=1e-13)
  
      nc_wt2 = wald_test_noncent(
          res_ols.params, c_equal, v, res_ols, diff=None, joint=True
      )
      assert_allclose(nc_wt2, nc_wt, rtol=1e-13)
  
      es_ols = nc_wt / nobs_t
      es_oneway = smo.effectsize_oneway(
          res_ols.params, res_ols.scale, self.nobs, use_var="equal"
      )
      assert_allclose(es_ols, es_oneway, rtol=1e-13)
  
      alpha = 0.05
      pow_ols = smpwr.ftest_power(
          np.sqrt(es_ols), df_denom, df_num, alpha, ncc=1
      )
      pow_oneway = smpwr.ftest_anova_power(
          np.sqrt(es_oneway), nobs_t, alpha, k_groups=k, df=None
      )
      assert_allclose(pow_ols, pow_oneway, rtol=1e-13)
  
      # noncentrality at other params
      params_alt = res_ols.params * 0.75
      # compute constraint value so we can get noncentrality from wald_test
      v_off = _offset_constraint(c_equal, res_ols.params, params_alt)
      wt_off = res_ols.wald_test((c_equal, v + v_off), scalar=True)
      nc_wt_off = wald_test_noncent_generic(
          params_alt, c_equal, v, cov_p, diff=None, joint=True
      )
      assert_allclose(
          nc_wt_off, wt_off.statistic * wt_off.df_num, rtol=1e-13
      )
  
      # check vectorized version, joint=False
      nc_wt_vec = wald_test_noncent_generic(
          params_alt, c_equal, v, cov_p, diff=None, joint=False
      )
      for i in range(c_equal.shape[0]):
          nc_wt_i = wald_test_noncent_generic(
              params_alt,
              c_equal[i : i + 1],  # noqa
              v[i : i + 1],
              cov_p,
              diff=None,  # noqa
              joint=False,
          )
          assert_allclose(nc_wt_vec[i], nc_wt_i, rtol=1e-13)
  
imports: import numpy
  from numpy.testing import assert_allclose, assert_equal
  import pytest
  from statsmodels.regression.linear_model import OLS
  import statsmodels.stats.power
  import statsmodels.stats.oneway
  from statsmodels.stats.oneway import confint_effectsize_oneway, confint_noncentrality, effectsize_oneway, anova_oneway, anova_generic, equivalence_oneway, equivalence_oneway_generic, power_equivalence_oneway, _power_equivalence_oneway_emp, f2_to_wellek, fstat_to_wellek, wellek_to_f2
  from statsmodels.stats.robust_compare import scale_transform
  from statsmodels.stats.contrast import wald_test_noncent_generic, wald_test_noncent, _offset_constraint
label_desc: Use image node_id 2 for calling the TestOnewayOLS obj's underlying member method code with example usage: obj.test_ols_noncentrality() without return types