H0 : Hair and eye colour are independent
H1 : Hair and eye colour are associated
χ2="\\sum"ri=1 "\\sum" cj=1=(Oij-Eij)2/Eij
Eij=RiCj/N, Ri - sum of i-th row, Cj - sum of j-th column, N - total sample size
E11=(80*120)/300=32, (O11-E11)2=4
E12=(80*60)/300=16, (O12-E12)2=36
E13=(80*120)/300=32, (O13-E13)2=64
E21=(100*120)/300=40, (O21-E21)2=0
E22=(100*60)/300=20, (O22-E22)2=0
E23=(100*120)/300=40, (O23-E23)2=0
E31=(120*120)/300=48, (O31-E31)2=4
E32=(120*60)/300=24, (O32-E32)2=36
E33=(120*120)/300=48, (O33-E33)2=64
χ2=7.29
degrees of freedom: (r-1)(c-1)=4
the critical value of chi square with 4df at 5% level significance: 9.488
χ2<critical value, so we accept H0 ,so hair colour is independent of eye colour
Comments
Leave a comment