code: def test_ordinal_association():
      for k, table in enumerate(tables):
          row_scores = 1 + np.arange(table.shape[0])
          col_scores = 1 + np.arange(table.shape[1])
  
          # First set of scores
          rslt = ctab.Table(
              table, shift_zeros=False
          ).test_ordinal_association(row_scores, col_scores)
          assert_allclose(rslt.statistic, r_results.loc[k, "lbl_stat"])
          assert_allclose(
              rslt.null_mean, r_results.loc[k, "lbl_expval"]
          )
          assert_allclose(
              rslt.null_sd**2, r_results.loc[k, "lbl_var"]
          )
          assert_allclose(
              rslt.zscore**2,
              r_results.loc[k, "lbl_chi2"],
              rtol=1e-5,
              atol=1e-5,
          )
          assert_allclose(
              rslt.pvalue,
              r_results.loc[k, "lbl_pvalue"],
              rtol=1e-5,
              atol=1e-5,
          )
  
          # Second set of scores
          rslt = ctab.Table(
              table, shift_zeros=False
          ).test_ordinal_association(row_scores, col_scores**2)
          assert_allclose(rslt.statistic, r_results.loc[k, "lbl2_stat"])
          assert_allclose(
              rslt.null_mean, r_results.loc[k, "lbl2_expval"]
          )
          assert_allclose(
              rslt.null_sd**2, r_results.loc[k, "lbl2_var"]
          )
          assert_allclose(
              rslt.zscore**2, r_results.loc[k, "lbl2_chi2"]
          )
          assert_allclose(
              rslt.pvalue,
              r_results.loc[k, "lbl2_pvalue"],
              rtol=1e-5,
              atol=1e-5,
          )
  
imports: import os
  import warnings
  import numpy
  import statsmodels.stats.contingency_tables
  import pandas
  from numpy.testing import assert_allclose, assert_equal
  import statsmodels.api
label_desc: Use image node_id 9 for calling a global function with example usage: test_ordinal_association() without return types