Stuart-Maxwell test of marginal homogeneity of a square table (paired classifications into the same categories).
Equivalent to DescTools::StuartMaxwellTest() in R. The degrees of freedom differ where categories are removed.
Categories with no counts off the diagonal (in their row and column) are removed. With the K categories left, d
the differences of the row and column sums of the first K - 1 and S their covariance (S_ii = r_i + c_i - 2 x_ii,
S_ij = -(x_ij + x_ji)), the statistic d' S^-1 d is chi-squared with K - 1 degrees of freedom (DescTools keeps the
original number of categories less 1). For a 2 x 2 table it is McNemar's statistic without correction.
RangeError for a table that is not square with at least two rows, negative or non-finite counts, fewer
than 2 categories left ("Too many equal marginals, cannot compute") and categories whose off-diagonal counts fall
into unconnected groups (S is then singular).
Stuart-Maxwell test of marginal homogeneity of a square table (paired classifications into the same categories). Equivalent to
DescTools::StuartMaxwellTest()in R. The degrees of freedom differ where categories are removed.Categories with no counts off the diagonal (in their row and column) are removed. With the K categories left,
dthe differences of the row and column sums of the first K - 1 andStheir covariance (S_ii = r_i + c_i - 2 x_ii,S_ij = -(x_ij + x_ji)), the statisticd' S^-1 dis chi-squared with K - 1 degrees of freedom (DescTools keeps the original number of categories less 1). For a 2 x 2 table it is McNemar's statistic without correction.