Download Chi-Square (χ2) Goodness-of-Fit Test: Analyzing Observed vs. Expected Frequencies - Prof. and more Study notes Statistics in PDF only on Docsity! 1 Chi-Square (χ2) Test A Chi-Square hypothesis test is used to compare observed frequency distributions (sample data) to distributions we expected to observe according to some idea (hypothesized values). Chi-Square (χ2) Test We are testing to see if the idea was a “good fit” or not. That is, we want to determine if the expected values reasonably match (or fit) the observed values. χ2 “Goodness-of-Fit” Test H0: The “idea” used to generate the expected values is valid (Good-Fit) H1: The “idea” used to generate the expected values is not valid (Bad-Fit) 2 χ2 “Goodness-of-Fit” Test Test Statistic Formula : where Oi are the observed values (data), Ei are the expected values (Ei = npi), and k is the number of categories. 2 2 1 ( )k i i i i O E E= − Χ =∑ Let α = “level of significance” χ2 “Goodness-of-Fit” Test Enter the observed values in L1 Enter the expected values in L2 [PRGM] ▼ X2GOF [ENTER] [ENTER] If p-value ≤ α, reject Ho. If p-value > α, fail to reject Ho. χ2 “Goodness-of-Fit” Test If you reject H0, the “idea” used to generate the expected values is not valid. It was a “bad-fit”. If you fail to reject H0, the “idea” used to generate the expected values is valid. It was a “good-fit”. 5 Prediction We predict that … ____ % will pick Blue, ____ % will pick Red, and ____ % will pick Yellow to be their favorite primary color. Question Is our predicted percentages for peoples favorite primary colors accurate? We need to conduct a χ2 goodness-of-fit test to answer this question. χ2 “Goodness-of-Fit” Test H0: Our predicted percentages for peoples favorite primary colors are accurate. H1: Our predicted percentages for peoples favorite primary colors are not accurate. Let α = 5% 6 Data E3 =O3 =Yellow n =n =Total E2 =O2 =Red E1 =O1 =Blue ExpectedObservedFavorite Primary Color i iE np= Calculations Conclusion 7 Example Randomly pick a number from 1 to 4. Question: When asked to do so, do people pick numbers from 1 to 4 randomly? Solution Picking at random would mean that each number had the same chance of being selected. Thus, for each of the four numbers. 1 0.25 25% 4 p = = = χ2 “Goodness-of-Fit” Test H0: People pick numbers from 1 to 4 randomly when asked to do so. H1: People do not pick numbers from 1 to 4 randomly when asked to do so. Let α = 5%