guodness-of-fit test examines the null hypothesis that the prob- abilities of th
ID: 3364122 • Letter: G
Question
guodness-of-fit test examines the null hypothesis that the prob- abilities of the k possible outcomes for a categorical variable are equal to a par- ticular set of values, pi. P2.... Pk. The data for the test are the observed counts in the k cells,2 Expected cell counts under the null hypothesis ane expected count npi where n is the total number of observations. The chi-square statistic measures how much the observed cell counts differ from the expected cell counts. The formula for the statistic is · (observed count expected count) expected count The degrees of freedom are k - 1, and P-values are computed from the chi-square distribution. Use this procedure when the expected counts are all 5 or more. page 458; for 9.3 and 9.6, see page 462 for 9.9 and 9.10, ge 466: for 9.12 14, see page 473; r 9.16, see (a) Use numerical summaries to describe the data. Give a justification for the summaries that you choose. (b) State appropriate null and alternative hypotheses for this setting (c) Give the results of the significance test for these data. Be sure to include the test statistic, the degrees of freedom, and the P-value. (d) Make a mosaic plot if you have the needed software. (e) Write a short summary of what you have found including your conclusion. tudy of tipping nship between the erver and whether Here are the data articipated in 9.18 To tip or not to tip: women customers. Refer to the previous exercise. Here are the data for the 304 female customers who participated in the study. TIPPEM Shirt color t color Yellow Blue Green 25 42 Tip Black White Red Yellow Blue Green Yes No 33 32 38 31 31 37 18 18 16 15 19 27 43 31Explanation / Answer
Solution:
Here, we have to use Chi square test for independence of two categorical variables. The null and alternative hypothesis for this test is given as below:
Null hypothesis: H0: Two categorical variables shirt color and tip are independent from each other.
Alternative hypothesis: Ha: Two categorical variables shirt color and tip are not independent from each other.
The level of significance or alpha value for this test is given as 0.05 or 5%.
The test statistic formula for this test is given as below:
Chi square = (O - E)^2/E
Where, O is observed frequencies and E is expected frequencies.
Expected frequencies are calculated as below:
Expected frequency = E = Row total * Column total / Grand total
Calculation tables for this test are summarized as below:
Observed Frequencies
Shirt Color
Tip
Black
White
Red
Yellow
Blue
Green
Total
Yes
18
16
15
19
16
18
102
No
33
32
38
31
31
37
202
Total
51
48
53
50
47
55
304
Expected Frequencies
Shirt Color
Tip
Black
White
Red
Yellow
Blue
Green
Total
Yes
17.11184
16.10526
17.78289
16.77632
15.76974
18.45395
102
No
33.88816
31.89474
35.21711
33.22368
31.23026
36.54605
202
Total
51
48
53
50
47
55
304
(O - E)
0.888158
-0.10526
-2.78289
2.223684
0.230263
-0.45395
-0.88816
0.105263
2.782895
-2.22368
-0.23026
0.453947
(O - E)^2/E
0.046098
0.000688
0.435503
0.294747
0.003362
0.011167
0.023277
0.000347
0.219907
0.148833
0.001698
0.005639
Number of rows = r = 2
Number of columns = c = 6
Degrees of freedom = (r – 1)*(c – 1) = (2 – 1)*(6 – 1) = 1*5 = 5
Level of significance = = 0.05
Test statistic = Chi square = (O - E)^2/E = 1.191266
Critical value = 11.0705
P-value = 0.945712
(Critical value and P-value are calculated by using Chi square table or excel)
P-value > = 0.05
So, we do not reject the null hypothesis that the two categorical variables shirt color and tip are independent.
There is sufficient evidence to conclude that the two categorical variables shirt color and tip are independent.
Observed Frequencies
Shirt Color
Tip
Black
White
Red
Yellow
Blue
Green
Total
Yes
18
16
15
19
16
18
102
No
33
32
38
31
31
37
202
Total
51
48
53
50
47
55
304
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.