code: def test_power_poisson_equal():
      # Example from Chapter 436: Tests for the Difference Between Two Poisson
      # Rates
      # equality null H0: rate1 = rate2
      #
      # Power N1 N2 N rate1 rate2 diff(rate2-rate1) ratio(rate2/rate1) Alpha
      # 0.82566 8 6 14 10.00 15.00 5.00 1.5000 0.050
      #
      # "1" is reference group
      # we use group 2 reference
  
      nobs1, nobs2 = 6, 8
      nobs_ratio = nobs2 / nobs1
      rate1, rate2 = 15, 10
  
      pow_ = power_poisson_diff_2indep(
          rate1,
          rate2,
          nobs1,
          nobs_ratio=nobs_ratio,
          alpha=0.05,
          value=0,
          method_var="alt",
          alternative="larger",
          return_results=True,
      )
      assert_allclose(pow_.power, 0.82566, atol=5e-5)
  
      # This supports now nonzero value
      # example in table 1 of Stucke, Kieser (2013)
      # regression numbers but close to exact power in table
  
      pow_ = power_poisson_diff_2indep(
          0.6,
          0.6,
          97,
          3 / 2,
          value=0.3,
          alpha=0.025,
          alternative="smaller",
          method_var="score",
          return_results=True,
      )
  
      assert_allclose(pow_.power, 0.802596, atol=5e-5)
  
      pow_ = power_poisson_diff_2indep(
          0.6,
          0.6,
          128,
          2 / 3,
          value=0.3,
          alpha=0.025,
          alternative="smaller",
          method_var="score",
          return_results=True,
      )
  
      assert_allclose(pow_.power, 0.80194, atol=5e-5)
  
imports: import pytest
  import warnings
  import numpy
  from numpy import arange
  from numpy.testing import assert_allclose, assert_equal
  from scipy import stats
  import statsmodels.stats.rates
  from statsmodels.stats.rates import confint_poisson, tolerance_int_poisson, confint_quantile_poisson, etest_poisson_2indep, confint_poisson_2indep, nonequivalence_poisson_2indep, power_poisson_ratio_2indep, power_equivalence_poisson_2indep, power_poisson_diff_2indep, power_equivalence_neginb_2indep, power_negbin_ratio_2indep, method_names_poisson_1samp, method_names_poisson_2indep
label_desc: Use image node_id 16 for calling a global function with example usage: test_power_poisson_equal() without return types