statsmodels.stats.contingency_tables.Table2x2.from_data

method

classmethod Table2x2.from_data(data, shift_zeros=True)[source]

Construct a Table object from data.

Parameters
dataarray-like

The raw data, the first column defines the rows and the second column defines the columns.

shift_zerosboolean

If True, and if there are any zeros in the contingency table, add 0.5 to all four cells of the table.