bayesplain.core.dirichlet_multinomial.cramers_v¶
- bayesplain.core.dirichlet_multinomial.cramers_v(prob_tables)[source]¶
Cramer’s V for one or many tables of probabilities.
Computed from probabilities rather than counts, so it does not depend on sample size:
\[\phi^2 = \sum_{ij} \frac{(p_{ij} - p_{i\cdot}p_{\cdot j})^2} {p_{i\cdot}p_{\cdot j}}, \qquad V = \sqrt{\frac{\phi^2}{\min(R-1,\, C-1)}}\]Applied to draws from
posterior_cell_draws(), this yields a posterior distribution over association strength – the thing a chi-square test cannot give you.