code: def test_levene(self):
      data = self.data
  
      # lawstat: Test Statistic = 1.0866123063642, p-value = 0.3471072204516
      statistic = 1.0866123063642
      p_value = 0.3471072204516
      res0 = smo.test_scale_oneway(
          data,
          method="equal",
          center="median",
          transform="abs",
          trim_frac_mean=0.2,
      )
      assert_allclose(res0.pvalue, p_value, rtol=1e-13)
      assert_allclose(res0.statistic, statistic, rtol=1e-13)
  
      # library car
      # > lt = leveneTest(y ~ g, df3, center=mean, trim=0.2)
      statistic = 1.10732113109744
      p_value = 0.340359251994645
      df = [2, 40]
      res0 = smo.test_scale_oneway(
          data,
          method="equal",
          center="trimmed",
          transform="abs",
          trim_frac_mean=0.2,
      )
      assert_allclose(res0.pvalue, p_value, rtol=1e-13)
      assert_allclose(res0.statistic, statistic, rtol=1e-13)
      assert_allclose(res0.df, df)
  
      # library(onewaytests)
      # test uses mean as center
      # > st = homog.test(y ~ g, df3)
      statistic = 1.07894485177512
      parameter = [2, 40]  # df
      p_value = 0.349641166869223
      # method = "Levene's Homogeneity Test"
      res0 = smo.test_scale_oneway(
          data,
          method="equal",
          center="mean",
          transform="abs",
          trim_frac_mean=0.2,
      )
      assert_allclose(res0.pvalue, p_value, rtol=1e-13)
      assert_allclose(res0.statistic, statistic, rtol=1e-13)
      assert_allclose(res0.df, parameter)
  
      # > st = homog.test(y ~ g, df3, method = "Bartlett")
      statistic = 3.01982414477323
      # parameter = 2  # scipy bartlett does not return df
      p_value = 0.220929402900495
      # method = "Bartlett's Homogeneity Test"
      # Bartlett is in scipy.stats
      from scipy import stats
  
      stat, pv = stats.bartlett(*data)
      assert_allclose(pv, p_value, rtol=1e-13)
      assert_allclose(stat, statistic, 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 3 for calling the TestOnewayScale obj's underlying member method code with example usage: obj.test_levene() without return types