Chi Square Test Of Independence Example. When one event has no effect on the occurrence of another event we say that the two events are independent. A chi square test of independence can be used to determine if there is an association between two categorical variables in a many different settings.
We want to know if gender is associated with political party preference so we survey 500 voters and record their gender and political party preference. It is a nonparametric test. A chi square test of independence can be used to determine if there is an association between two categorical variables in a many different settings.
Chi square test of association.
Demonstrating the chi squared test of independence in r by eric cai the chemical statistician entering the data into vectors men c 100 120 60 women c 350 200 90 combining the row vectors in matrices then converting the matrix into a data frame ice cream survey as data frame rbind men women assigning column names to this data frame names ice cream survey c chocolate vanilla strawberry chisq test ice cream survey. The test statistic for the chi square test of independence is denoted χ 2 and is computed as. The chi square test of independence determines whether there is an association between categorical variables i e whether the variables are independent or related. Examples of categorical variables are gender male female opinions e g.