Chi-Square Test Math Example 2

Follow the full solution, then compare it with the other examples linked below.

Example 2

hard
A 2×2 table: Men: 30 prefer A, 20 prefer B. Women: 15 prefer A, 35 prefer B. Test independence of gender and preference at α=0.05\alpha=0.05.

Solution

  1. 1
    Observed: Men-A=30, Men-B=20, Women-A=15, Women-B=35; Row totals: Men=50, Women=50; Column totals: A=45, B=55; Grand total=100
  2. 2
    Expected: Eij=row total×col totalgrand totalE_{ij} = \frac{\text{row total} \times \text{col total}}{\text{grand total}}; EMA=50×45/100=22.5E_{MA} = 50\times45/100=22.5; EMB=27.5E_{MB}=27.5; EWA=22.5E_{WA}=22.5; EWB=27.5E_{WB}=27.5
  3. 3
    χ2=(3022.5)222.5+(2027.5)227.5+(1522.5)222.5+(3527.5)227.5=2.5+2.045+2.5+2.045=9.09\chi^2 = \frac{(30-22.5)^2}{22.5} + \frac{(20-27.5)^2}{27.5} + \frac{(15-22.5)^2}{22.5} + \frac{(35-27.5)^2}{27.5} = 2.5 + 2.045 + 2.5 + 2.045 = 9.09
  4. 4
    df =(21)(21)=1= (2-1)(2-1) = 1; critical value χ0.05,12=3.841\chi^2_{0.05,1} = 3.841; 9.09>3.8419.09 > 3.841 → Reject H0H_0

Answer

χ2=9.09>3.841\chi^2 = 9.09 > 3.841. Reject H0H_0. Gender and preference are associated.
Chi-square test of independence tests whether two categorical variables are associated in a contingency table. df = (rows-1)(cols-1). Rejecting H₀ means the variables are not independent — gender and preference are associated here.

About Chi-Square Test

A hypothesis test that compares observed frequencies to expected frequencies using the chi-square statistic to assess independence or goodness of fit.

Learn more about Chi-Square Test →

More Chi-Square Test Examples