2Chi-Square StatisticMeasures how far the observed values are from the expected valuesTake sum over all cells in tableWhen is large, there is evidence that H0 is false.
3Goodness of Fit (GOF) Tests We can use a chi-squared test to see if a frequency distribution fits a pattern.The hypotheses to these tests are written a little different than we have seen in the past because they are usually written in words.
4GOF Hypothesis TestA researcher wishes to see of the number of adults who do not have health insurance is equally distributed among three categories:CategoryLess than 12 years12 yearsMore than 12 yearsFrequency (observed)292011
5GOF Hypothesis Test Step 1 Ho: The number of people who do not have health insurance is equally distributed over the three categories.Ha: The number of people who do not have health insurance is not equally distributed over the three categories.
7GOF Hypothesis Test Step 4 Test Statistic = 8.1 Put Observed in L1 and Expected in L2L3 = (L1-L2)2 / L2Sum L3χ2 cdf (test stat, E99, df) = p-value = 0.017CategoryLess than 12 years12 yearsMore than 12 yearsFrequency (observed)292011Expected
8GOF Hypothesis Test Step 5 Step 6 Reject Ho There is enough evidence to suggest that the number of people who do not have health insurance is not equally distributed over the three categories.
9Two-Way TablesSummarizes the relationship between two categorical variablesRow = values for one categorical variableColumn = values for other categorical variableTable entries = number in row by column class
10Example of Two-Way Table Age GroupEduc25 to 3435 to 5455+TotalNo HS5,3259,15216,03530,512HS14,06124,07018,32056,451C. 1-311,65919,9269,66241,247C. 4+10,34219,8788,00538,22541,38873,02852,022166,438
11Independence of Categorical Variables. Is there a relationship between two categorical variables. Are two variables related to each other?Unrelated = independentRelated = dependent
12ExampleA 1992 poll conducted by the University of Montana classified respondents by sex and political party.Sex: Male and FemaleParty: Democrat, Republican, IndependentIs there evidence of an association between gender and party affiliation?
13Hypothesis Test for Independence HO: Sex and political party affiliation are independent (have no relationship).HA: Sex and political party affiliation are dependent (are related to each other.)
14Two-Way Tables Describe table with # of rows (r) and # of columns (c) r x c tableEach number in table is called a cellr times c cells in tableWe will use the two-way table to test our hypotheses.
15Data Democrat Republican Independent Total Male 36 45 24 105 Female 48 331697847840202
16Expected CountsIf HO is true, we would expect to get a certain number of counts in each cell.Expected cell count = row total * column totaltable total
17Example of Expected Counts Cell – Male and DemocratExpected Count =Cell – Male and RepublicanCell – Male and Independent
18Two-Way Table of Expected Counts DemocratRepublicanIndependentTotalobsexp13643.664540.542420.7910524840.343337.461619.2197847840202
19Expected Counts Expected cell count is close to observed cell count Evidence Ho is trueExpected cell count is far from observed cell countEvidence Ho is false
20Chi-Squared Test for Independence To test these hypotheses, we will use a Chi-Squared Test for Independence if the assumptions hold.Assumptions:Expected Cell Counts are all > 5
21Chi-Square StatisticMeasures how far the observed values are from the expected valuesTake sum over all cells in tableWhen is large, there is evidence that H0 is false.Your calculator will do this for you.
22Chi-Square Statistic Cell – Male and Democrat Observed Count = 36Expected Count = 43.66Cell – Male and RepublicanObserved Count = 45Expected Count = 40.54
23Chi-Square Statistic Repeat this process for all 6 cells χ2 = 4.85 As long as the assumptions are metχ2 will have a χ2 distribution with d.f. (r-1)(c-1)Sex has 2 categories (so r = 2); party has 3 categories (so c = 3)We have (2-1)(3-1) = 2 degrees of freedom
24Hypothesis Test P-value = P(χ2 > 4.85)= 0.09 Decision: Since p-value > α = 0.05, we will Do Not Reject HO.Conclusion: There is no evidence of a relationship between sex and political party affiliation.
25Homogeneity of Proportions Samples are selected from different populations and a researcher wants to determine whether the proportion of elements are common for each population.The hypotheses are:Ho: p1 = p2 = p3 = p4Ha: At least one is different
26Homogeneity of Proportions An advertising firm has decided to ask 92 customers at each of three local shopping malls if they are willing to take part in a market research survey. According to previous studies, 38% of Americans refuse to take part in such surveys. At α = 0.01, test the claim that the proportions are equal.
27Homogeneity of Proportions Step 1Ho: p1 = p2 = p3Ha: At least oneis differentStep 2α = 0.01Step 3MallABMall CTotalWill Participate524536133Will not participate40475614392276
28Homogeneity of Proportions Step 4Put into your calculatorObserved in matrix AExpected in matrix BTest statistic = 5.602P-value = 0.06
29Homogeneity of Proportions Step 5Do Not Reject HoStep 6There is not sufficient evidence to suggest that at least one is different.