scipy.stats.contingency.association(observed, method='cramer', correction=False, lambda_=None)[source]#

Calculates degree of association between two nominal variables.

The function provides the option for computing one of three measures of association between two nominal variables from the data given in a 2d contingency table: Tschuprow’s T, Pearson’s Contingency Coefficient and Cramer’s V.


The array of observed values

method{“cramer”, “tschuprow”, “pearson”} (default = “cramer”)

The association test statistic.

correctionbool, optional

Inherited from scipy.stats.contingency.chi2_contingency()

lambda_float or str, optional

Inherited from scipy.stats.contingency.chi2_contingency()


Value of the test statistic


Cramer’s V, Tschuprow’s T and Pearson’s Contingency Coefficient, all measure the degree to which two nominal or ordinal variables are related, or the level of their association. This differs from correlation, although many often mistakenly consider them equivalent. Correlation measures in what way two variables are related, whereas, association measures how related the variables are. As such, association does not subsume independent variables, and is rather a test of independence. A value of 1.0 indicates perfect association, and 0.0 means the variables have no association.

Both the Cramer’s V and Tschuprow’s T are extensions of the phi coefficient. Moreover, due to the close relationship between the Cramer’s V and Tschuprow’s T the returned values can often be similar or even equivalent. They are likely to diverge more as the array shape diverges from a 2x2.



Tschuprow, A. A. (1939) Principles of the Mathematical Theory of Correlation; translated by M. Kantorowitsch. W. Hodge & Co.


“Nominal Association: Phi and Cramer’s V”,


Gingrich, Paul, “Association Between Variables”,


An example with a 4x2 contingency table:

>>> import numpy as np
>>> from scipy.stats.contingency import association
>>> obs4x2 = np.array([[100, 150], [203, 322], [420, 700], [320, 210]])

Pearson’s contingency coefficient

>>> association(obs4x2, method="pearson")

Cramer’s V

>>> association(obs4x2, method="cramer")

Tschuprow’s T

>>> association(obs4x2, method="tschuprow")