13.2 Inference for Two Way Tables
Analyze Two Way Tables Using Chi-Squared Test for Homogeneity and Independence
Goodness of Fit HomogeneityIndependence 1 variable -distribution 2 variables (2 way table) -distribution -proportions 2 variables (2 way table) -association -dependent upon -relationship -influences
Is there evidence the wheel is unbalanced? (one variable- prize you get) PrizeTeddy Bear GoldfishT-shirtPoster # of winners
Is there evidence that proportion of kids who attend regular MGS is different for each grade level. Notice it is a 2-way table with two categorical variables: Grade level and whether you attend MGS FreshmenSophomoreJuniorSenior Attend MGS Does Not Attend MGS
This is the same thing as a test of homogeneity except the wording of the question will use key words such as association or relationship. We complete the same steps in our calculator, we just use a different name for our test and word our Ho and Ha different. Is there evidence of a relationship between grade level and kids who attend MGS regularly?
Expected Counts= Degrees of freedom (r-1)(c-1) Chi-Squared Test Statistic
Find the expected counts: First you need to find the row and column totals above. I did the first example-you fill in the rest! ExpectedFreshmenSophomoreJuniorSenior Attend MGS(286*142)/605 =67.13 Does Not Attend MGS ObservedFreshmenSophomoreJuniorSeniorTotal Attend MGS Does Not Attend MGS Total
Expected counts complete! Now let’s try the quick way. Follow along! Go to your calculator. Matrix-Edit-enter [A] Matrix[A] r x c (so change it to 2 x 4). Then input your observed counts. Then hit: stat-tests-x² test. Just hit calculate. It gives you your calculations but we can worry about those later!! Go back to matrix and hit enter on matrix [B]. When you hit enter again scroll through the matrix and notice your calculator did all the expected counts and they should match what you just did by hand! ExpectedFreshmenSophomoreJuniorSenior Attend MGS(286*142)/605 = Does Not Attend MGS X²-test Observed:[A] Expected: [B] Calculate
df =(r-1)(c-1) =(2-1)(4-1) =1*3=3 ObservedFreshmenSophomoreJuniorSeniorTotal Attend MGS Does Not Attend MGS Total
H₀:the proportion of ________ is the SAME as __________ Ha: the proportion of ________ is DIFFERENT than __________ (these are just template sentences, remember whatever the question is asking is your Ha)
Example 1: Do the boys’ preferences for the following TV programs differ significantly from the girls’ preferences? Use a 5% significance level. HouseGrey’s Anatomy American Idol CSI Boys Girls
H₀:the boys preference for TV programs is the SAME as the girls Ha: the boys preference for TV programs is DIFFERENT than the girls Assumptions: -random sample -all expected counts are ≥ 1 -no more than 20% of the expected counts <5 HouseGrey’s Anatomy American Idol CSI Boys Girls
Chi-Squared Test (Homogeneity) w/ α=0.05 P(x²>41.08)= df=3 Since p< α, it is statistically significant. Therefore we reject H₀. There is enough evidence to say the preference of TV programs for boys is different than girls.
Example 2: The following data is an SRS of 650 patients at a local hospital. Does the effect of aspirin significantly differ from a placebo for these medical conditions? AspirinPlacebo Fatal Heart Attacks 2060 Non-Fatal Heart Attacks Strokes75150
H₀:the effects of aspirin is the same as the placebo Ha: the effects of aspirin is different than the placebo Assumptions: -random sample -all expected counts are ≥ 1 -no more than 20% of the expected counts <5 AspirinPlacebo Fatal Heart Attacks Non-Fatal Heart Attacks Strokes
Chi-Squared Test (Homogeneity) w/ α=0.05 P(x²>3.70)= df=2 Since p∡ α, it is not statistically significant. Therefore we do not reject H₀. There is not enough evidence to say the effect of aspirin differs from the placebo.
H₀: There is no relationship (association) between ________ and ________. Ha: There is a relationship (association) between ________ and ________.
Example 3: An SRS of 1000 was taken Is there a relationship between gender and political parties? RepublicanDemocratIndependent Male Female
H₀: There is no relationship between gender and political party Ha: There is a relationship between gender and political party Assumptions: -random sample -all expected counts are ≥ 1 -no more than 20% of the expected counts <5 RepublicanDemocratIndependent Male Female270 60
Chi-Squared Test (Independence) w/ α=0.05 P(x²>16.2)= df=2 Since p< α, it is statistically significant. Therefore we reject H₀. There is enough evidence to say there is a relationship between gender and political party
Example 4: An SRS of 592 people were taken comparing their hair and eye color. Is there an association between hair color and eye color? BlackBrownRedBlonde Brown Green Blue Hazel
H₀: There is no association between hair color and eye color Ha: There is an association between hair color and eye color Assumptions: -random sample -all expected counts are ≥ 1 -no more than 20% of the expected counts <5 BlackBrownRedBlonde Brown Green Blue Hazel
Chi-Squared Test (Independence) w/ α=0.05 P(x²>134.98)≈0 df=9 Since p< α, it is statistically significant. Therefore we reject H₀. There is enough evidence to say there is an association between hair color and eye color