code: def test_chisquare_adult_dataset(self):
      # Comparison values taken from dagitty (DAGitty)
      coef, p_value, dof = chi_square(
          X="Age",
          Y="Immigrant",
          Z=[],
          data=self.df_adult,
          boolean=False,
      )
      np_test.assert_almost_equal(coef, 57.75, decimal=1)
      np_test.assert_almost_equal(np.log(p_value), -25.47, decimal=1)
      self.assertEqual(dof, 4)
  
      coef, p_value, dof = chi_square(
          X="Age", Y="Race", Z=[], data=self.df_adult, boolean=False
      )
      np_test.assert_almost_equal(coef, 56.25, decimal=1)
      np_test.assert_almost_equal(np.log(p_value), -24.75, decimal=1)
      self.assertEqual(dof, 4)
  
      coef, p_value, dof = chi_square(
          X="Age", Y="Sex", Z=[], data=self.df_adult, boolean=False
      )
      np_test.assert_almost_equal(coef, 289.62, decimal=1)
      np_test.assert_almost_equal(np.log(p_value), -139.82, decimal=1)
      self.assertEqual(dof, 4)
  
      coef, p_value, dof = chi_square(
          X="Education",
          Y="HoursPerWeek",
          Z=["Age", "Immigrant", "Race", "Sex"],
          data=self.df_adult,
          boolean=False,
      )
      np_test.assert_almost_equal(coef, 1460.11, decimal=1)
      np_test.assert_almost_equal(p_value, 0, decimal=1)
      self.assertEqual(dof, 316)
  
      coef, p_value, dof = chi_square(
          X="Immigrant",
          Y="Sex",
          Z=[],
          data=self.df_adult,
          boolean=False,
      )
      np_test.assert_almost_equal(coef, 0.2724, decimal=1)
      np_test.assert_almost_equal(np.log(p_value), -0.50, decimal=1)
      self.assertEqual(dof, 1)
  
      coef, p_value, dof = chi_square(
          X="Education",
          Y="MaritalStatus",
          Z=["Age", "Sex"],
          data=self.df_adult,
          boolean=False,
      )
      np_test.assert_almost_equal(coef, 481.96, decimal=1)
      np_test.assert_almost_equal(p_value, 0, decimal=1)
      self.assertEqual(dof, 58)
  
      # Values differ (for next 2 tests) from dagitty because dagitty ignores grouped
      # dataframes with very few samples. Update: Might be same from scipy=1.7.0
      coef, p_value, dof = chi_square(
          X="Income",
          Y="Race",
          Z=["Age", "Education", "HoursPerWeek", "MaritalStatus"],
          data=self.df_adult,
          boolean=False,
      )
      np_test.assert_almost_equal(coef, 66.39, decimal=1)
      np_test.assert_almost_equal(p_value, 0.99, decimal=1)
      self.assertEqual(dof, 136)
  
      coef, p_value, dof = chi_square(
          X="Immigrant",
          Y="Income",
          Z=["Age", "Education", "HoursPerWeek", "MaritalStatus"],
          data=self.df_adult,
          boolean=False,
      )
      np_test.assert_almost_equal(coef, 65.59, decimal=1)
      np_test.assert_almost_equal(p_value, 0.999, decimal=2)
      self.assertEqual(dof, 131)
  
file_path: pgmpy/pgmpy/tests/test_estimators/test_CITests.py
imports: import unittest
  import math
  import numpy
  import pandas
  from numpy import testing
  from pgmpy.estimators.CITests import *
label_desc: Use image node_id 2 for calling the TestChiSquare obj's underlying member method code with example usage: obj.test_chisquare_adult_dataset() without return types