code: def test_cancorr():
      # Compare results to SAS example:
      # https://support.sas.com/documentation/cdl/en/statug/63347/HTML/default/
      # viewer.htm#statug_cancorr_sect020.htm
      X1 = data_fit.iloc[:, :3]
      Y1 = data_fit.iloc[:, 3:]
      mod = CanCorr(Y1, X1)
      r = mod.corr_test()
      assert_almost_equal(
          r.stats_mv.loc["Wilks' lambda", "Value"],
          0.35039053,
          decimal=8,
      )
      assert_almost_equal(
          r.stats_mv.loc["Pillai's trace", "Value"],
          0.67848151,
          decimal=8,
      )
      assert_almost_equal(
          r.stats_mv.loc["Hotelling-Lawley trace", "Value"],
          1.77194146,
          decimal=8,
      )
      assert_almost_equal(
          r.stats_mv.loc["Roy's greatest root", "Value"],
          1.72473874,
          decimal=8,
      )
      assert_almost_equal(
          r.stats_mv.loc["Wilks' lambda", "F Value"], 2.05, decimal=2
      )
      assert_almost_equal(
          r.stats_mv.loc["Pillai's trace", "F Value"], 1.56, decimal=2
      )
      assert_almost_equal(
          r.stats_mv.loc["Hotelling-Lawley trace", "F Value"],
          2.64,
          decimal=2,
      )
      assert_almost_equal(
          r.stats_mv.loc["Roy's greatest root", "F Value"],
          9.20,
          decimal=2,
      )
      assert_almost_equal(
          r.stats_mv.loc["Wilks' lambda", "Num DF"], 9, decimal=3
      )
      assert_almost_equal(
          r.stats_mv.loc["Pillai's trace", "Num DF"], 9, decimal=3
      )
      assert_almost_equal(
          r.stats_mv.loc["Hotelling-Lawley trace", "Num DF"],
          9,
          decimal=3,
      )
      assert_almost_equal(
          r.stats_mv.loc["Roy's greatest root", "Num DF"], 3, decimal=3
      )
      assert_almost_equal(
          r.stats_mv.loc["Wilks' lambda", "Den DF"], 34.223, decimal=3
      )
      assert_almost_equal(
          r.stats_mv.loc["Pillai's trace", "Den DF"], 48, decimal=3
      )
      assert_almost_equal(
          r.stats_mv.loc["Hotelling-Lawley trace", "Den DF"],
          19.053,
          decimal=3,
      )
      assert_almost_equal(
          r.stats_mv.loc["Roy's greatest root", "Den DF"], 16, decimal=3
      )
      assert_almost_equal(
          r.stats_mv.loc["Wilks' lambda", "Pr > F"], 0.0635, decimal=4
      )
      assert_almost_equal(
          r.stats_mv.loc["Pillai's trace", "Pr > F"], 0.1551, decimal=4
      )
      assert_almost_equal(
          r.stats_mv.loc["Hotelling-Lawley trace", "Pr > F"],
          0.0357,
          decimal=4,
      )
      assert_almost_equal(
          r.stats_mv.loc["Roy's greatest root", "Pr > F"],
          0.0009,
          decimal=4,
      )
      assert_almost_equal(
          r.stats.loc[0, "Wilks' lambda"], 0.35039053, decimal=8
      )
      assert_almost_equal(
          r.stats.loc[1, "Wilks' lambda"], 0.95472266, decimal=8
      )
      assert_almost_equal(
          r.stats.loc[2, "Wilks' lambda"], 0.99473355, decimal=8
      )
      assert_almost_equal(r.stats.loc[0, "F Value"], 2.05, decimal=2)
      assert_almost_equal(r.stats.loc[1, "F Value"], 0.18, decimal=2)
      assert_almost_equal(r.stats.loc[2, "F Value"], 0.08, decimal=2)
      assert_almost_equal(r.stats.loc[0, "Num DF"], 9, decimal=2)
      assert_almost_equal(r.stats.loc[1, "Num DF"], 4, decimal=2)
      assert_almost_equal(r.stats.loc[2, "Num DF"], 1, decimal=2)
      assert_almost_equal(r.stats.loc[0, "Den DF"], 34.223, decimal=3)
      assert_almost_equal(r.stats.loc[1, "Den DF"], 30, decimal=2)
      assert_almost_equal(r.stats.loc[2, "Den DF"], 16, decimal=2)
      assert_almost_equal(r.stats.loc[0, "Pr > F"], 0.0635, decimal=4)
      assert_almost_equal(r.stats.loc[1, "Pr > F"], 0.9491, decimal=4)
      assert_almost_equal(r.stats.loc[2, "Pr > F"], 0.7748, decimal=4)
  
imports: import pandas
  from ..cancorr import CanCorr
  from numpy.testing import assert_almost_equal
label_desc: Use image node_id 1 for calling a global function with example usage: test_cancorr() without return types