code: def test_mcnemar_chisquare():
      f_obs1 = np.array([[101, 121], [59, 33]])
      f_obs2 = np.array([[101, 70], [59, 33]])
      f_obs3 = np.array([[101, 80], [59, 33]])
  
      # > mcn = mcnemar.test(matrix(c(101, 121,  59,  33),nrow=2))
      res1 = [2.067222e01, 5.450095e-06]
      res2 = [0.7751938, 0.3786151]
      res3 = [2.87769784, 0.08981434]
  
      stat = mcnemar(f_obs1, exact=False)
      assert_allclose([stat.statistic, stat.pvalue], res1, rtol=1e-6)
      stat = mcnemar(f_obs2, exact=False)
      assert_allclose([stat.statistic, stat.pvalue], res2, rtol=1e-6)
      stat = mcnemar(f_obs3, exact=False)
      assert_allclose([stat.statistic, stat.pvalue], res3, rtol=1e-6)
  
      # test correction = False
      res1 = [2.135556e01, 3.815136e-06]
      res2 = [0.9379845, 0.3327967]
      res3 = [3.17266187, 0.07488031]
  
      res = mcnemar(f_obs1, exact=False, correction=False)
      assert_allclose([res.statistic, res.pvalue], res1, rtol=1e-6)
      res = mcnemar(f_obs2, exact=False, correction=False)
      assert_allclose([res.statistic, res.pvalue], res2, rtol=1e-6)
      res = mcnemar(f_obs3, exact=False, correction=False)
      assert_allclose([res.statistic, res.pvalue], res3, rtol=1e-6)
  
imports: from statsmodels.compat.python import lzip
  import numpy
  from numpy.testing import assert_allclose, assert_almost_equal, assert_approx_equal, assert_
  from scipy import stats
  import pytest
  from statsmodels.stats.contingency_tables import mcnemar, cochrans_q, SquareTable
  from statsmodels.sandbox.stats.runs import Runs, runstest_1samp, runstest_2samp
  from statsmodels.sandbox.stats.runs import mcnemar
  from statsmodels.stats.nonparametric import rank_compare_2indep, rank_compare_2ordinal, prob_larger_continuous, cohensd2problarger
  from statsmodels.tools.testing import Holder
label_desc: Use image node_id 3 for calling a global function with example usage: test_mcnemar_chisquare() without return types