Cramer’s V - mauriceling/mauriceling.github.io GitHub Wiki

Purpose: Measures the degree of association between 2 categorical variables (defining the rows and columns).

Code:

>>> from scipy import stats
>>> table = [[77, 90, 404, 200],
             [16, 50, 122, 205],
             [20, 43, 150, 320]]
>>> result = stats.contingency.association(table, method="cramer")
>>> print("V = %.3f" % result)
V = 0.232

References:

  1. Cramér H. 1946. Mathematical Methods of Statistics. Princeton: Princeton University Press. ISBN 0-691-08004-6.