Work out contingency table instantly with clear inputs, formula shown and shareable results.
A two-by-two contingency table cross-tabulates two binary variables. Comparing each cell with its expected count under independence gives a chi-square statistic on one degree of freedom, and phi rescales it as a correlation.
Expected count
E = row total × column total / grand total
Phi coefficient
φ = √(χ² / N)
The expected counts are 30, 20, 30 and 20, so χ² = 100/30 + 100/20 + 100/30 + 100/20 ≈ 16.667 on 1 df, giving p ≈ 0.00004 and a phi of 0.4082.
When any expected count falls below about 5, where the chi-square approximation becomes unreliable.