code: def test_effectsize_fstat():
      # results from R package `effectsize`, confint is 0.9 confidence
      # > es = F_to_eta2(45.8, 3, 35)
      Eta_Sq_partial = 0.796983758700696
      CI_eta2 = (
          0.685670133284926,
          0.855981325777856,
      )  # reformated from output
      # > es = F_to_epsilon2(45.8, 3, 35)
      Epsilon_Sq_partial = 0.779582366589327
      CI_eps2 = 0.658727573280777, 0.843636867987386
      # > es = F_to_omega2(45.8, 3, 35)
      Omega_Sq_partial = 0.775086505190311
      CI_omega2 = 0.65286429480169, 0.840179680453464
      # > es = F_to_f(45.8, 3, 35)
      Cohens_f_partial = 1.98134153686695
      CI_f = 1.47694659580859, 2.43793847155554
  
      f_stat, df1, df2 = 45.8, 3, 35
      # nobs = df1 + df2 + 1  # not directly used in the following, only df
      fes = smo._fstat2effectsize(f_stat, (df1, df2))
      assert_allclose(np.sqrt(fes.f2), Cohens_f_partial, rtol=1e-13)
      assert_allclose(fes.eta2, Eta_Sq_partial, rtol=1e-13)
      assert_allclose(fes.eps2, Epsilon_Sq_partial, rtol=1e-13)
      assert_allclose(fes.omega2, Omega_Sq_partial, rtol=1e-13)
  
      ci_nc = confint_noncentrality(f_stat, (df1, df2), alpha=0.1)
      # the following replicates R package effectsize
      ci_es = smo._fstat2effectsize(ci_nc / df1, (df1, df2))
      assert_allclose(ci_es.eta2, CI_eta2, rtol=2e-4)
      assert_allclose(ci_es.eps2, CI_eps2, rtol=2e-4)
      assert_allclose(ci_es.omega2, CI_omega2, rtol=2e-4)
      assert_allclose(np.sqrt(ci_es.f2), CI_f, rtol=2e-4)
  
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 3 for calling a global function with example usage: test_effectsize_fstat() without return types