def test_ordinal_association(self, row_scores=None, col_scores=None):

        if row_scores is None:
            row_scores = np.arange(self.table.shape[0])

        if col_scores is None:
            col_scores = np.arange(self.table.shape[1])

        if len(row_scores) != self.table.shape[0]:
            raise ValueError("The length of `row_scores` must match the first dimension of `table`.")

        if len(col_scores) != self.table.shape[1]:
            raise ValueError("The length of `col_scores` must match the second dimension of `table`.")

        # The test statistic
        statistic = np.dot(row_scores, np.dot(self.table, col_scores))

        # Some needed quantities
        n_obs = self.table.sum()
        rtot = self.table.sum(1)
        um = np.dot(row_scores, rtot)
        u2m = np.dot(row_scores**2, rtot)
        ctot = self.table.sum(0)
        vn = np.dot(col_scores, ctot)
        v2n = np.dot(col_scores**2, ctot)

        # The null mean and variance of the test statistic
        e_stat = um * vn / n_obs
        v_stat = (u2m - um**2 / n_obs) * (v2n - vn**2 / n_obs) / (n_obs - 1)
        sd_stat = np.sqrt(v_stat)

        zscore = (statistic - e_stat) / sd_stat
        pvalue = 2 * stats.norm.cdf(-np.abs(zscore))

        b = _Bunch()
        b.statistic = statistic
        b.null_mean = e_stat
        b.null_sd = sd_stat
        b.zscore = zscore
        b.pvalue = pvalue
        return b
@case: HRM006
dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/stats/contingency_tables.py/Table.test_ordinal_association--crossover with--dataset/ETHPy150Open sahana/eden/modules/tests/staff/add_staff_to_office.py/AddStaffToOffice.test_hrm006_add_staff_to_office