statsmodels.stats.contingency_tables.SquareTable¶

class statsmodels.stats.contingency_tables.SquareTable(table, shift_zeros=True)[source]

Methods for analyzing a square contingency table.

Parameters
• table (array-like) – A square contingency table, or DataFrame that is converted to a square form.

• shift_zeros (boolean) – If True and any cell count is zero, add 0.5 to all values in the table.

• methods should only be used when the rows and columns of the (These) –

• have the same categories. If table is provided as a (table) –

• DataFrame, the row and column indices will be extended to (Pandas) –

• a square table, inserting zeros where a row or column is (create) –

• Otherwise the table should be provided in a square form, (missing.) –

• the (implicit) row and column categories appearing in the (with) –

• order. (same) –

Methods

 Returns the contributions to the chi^2 statistic for independence. Returns cumulative log odds ratios. Returns the cumulative odds ratios for a contingency table. Returns fitted cell counts under independence. from_data(data[, shift_zeros]) Construct a Table object from data. homogeneity([method]) Compare row and column marginal distributions. Returns fitted joint probabilities under independence. Returns local log odds ratios. Returns local odds ratios. Estimate marginal probability distributions for the rows and columns. Returns Pearson residuals. Returns standardized residuals under independence. summary([alpha, float_format]) Produce a summary of the analysis. symmetry([method]) Test for symmetry of a joint distribution. Assess independence for nominal factors. test_ordinal_association([row_scores, …]) Assess independence between two ordinal variables.