# Stats 2020 Tutorial. Chi-Square Goodness of Fit Steps Age < 20Age 20-29Age ≥ 30 6892140 0.160.280.56 fofo pepe fefe What we know: n = 300, α =.05 and...

## Presentation on theme: "Stats 2020 Tutorial. Chi-Square Goodness of Fit Steps Age < 20Age 20-29Age ≥ 30 6892140 0.160.280.56 fofo pepe fefe What we know: n = 300, α =.05 and..."— Presentation transcript:

Stats 2020 Tutorial

Chi-Square Goodness of Fit

Steps Age < 20Age 20-29Age ≥ 30 6892140 0.160.280.56 fofo pepe fefe What we know: n = 300, α =.05 and... The observed number (f o ) and percentage of drivers in each category:

Steps (cont.) 1. State the hypotheses: H o : The distribution of auto accidents is the same as the distribution of registered drivers. H 1 : The distribution of auto accidents is different/dependent/related to age.

Steps (cont.) 2. Locate the critical region df = C - 1 = 3 - 1 = 2 For df = 2 and α =.05, the critical 2 = 5.99 “C” is the number of columns

Steps (cont.) 3. Calculate the chi-square statistic fe = pn Age < 20:.16(300) = 48 Age 20-29:.28(300) = 84 Age ≥ 30:.56(300) = 168 Age < 20Age 20-29Age ≥ 30 6892140 0.160.280.56 4884168 fofo pepe fefe Notice that for both the observed (fo) and expected (fe) frequency, that the sum of the frequencies should equal n.

Steps (cont.) Age < 20Age 20-29Age ≥ 30 6892140 0.160.280.56 4884168 fofo pepe fefe 2 = (68-48) 2 /48 (92-84) 2 /84 (140-168) 2 /168+ + = 8.3333 +.7619 + 4.6667 = 13.76

Steps (cont.) 4. State a decision and conclusion Decision: Critical 2 = 5.99 Obtained 2 = 13.76 Therefore, reject Ho Conclusion (in APA format) The distribution of automobile accidents is not identical to the distribution of registered drivers, 2 (2, n = 300) = 13.76, p <.05. df = 2

Chi-Square Goodness of Fit

Steps OriginalEyes fartherEyes closer 517227 0.33 fofo pepe fefe What we know: n = 150, α =.05 and... Assuming all groups are equal, we divide our proportions equally into 3: 1/3 =.3333 for each proportion

Steps (cont.) 1. State the hypotheses: H o : There is no preference among the three photographs. H 1 : There is a preference among the three photographs.

Steps (cont.) 2. Locate the critical region df = C - 1 = 3 - 1 = 2 For df = 2 and α =.05, the critical 2 = 5.99

Steps (cont.) 3. Calculate the chi-square statistic fe = pn Original:.3333(150) = 50 Eyes farther:.3333(150) = 50 Eyes closer:.3333(150) = 50 OriginalEyes fartherEyes closer 517227 0.33 50 fofo pepe fefe

Steps (cont.) 2 = (51-50) 2 /50 (72-50) 2 /50 (27-50) 2 /50+ + =.02 + 9.68 + 10.58 = 20.28 OriginalEyes fartherEyes closer 517227 0.33 50 fofo pepe fefe

Steps (cont.) 4. State a decision and conclusion Decision: Critical 2 = 5.99 Obtained 2 = 20.28 Therefore, reject Ho Conclusion (in APA format) Participants showed significant preferences among the three photograph types, 2 (2, n = 150) = 20.28, p <.05.

Chi-Square Test for Independence

Steps What we know: n = 300, α =.05 and... Of the 300 participants, 100 are from the city, and 200 are from the suburbs FavourOppose City6832 Suburb86114 Opinion Residence Row totals Column totals154146 100 200 That is, 68+86 = 154 That is, 86+114 = 200

Steps (cont.) 1. State the hypotheses: H o : Opinion is independent of residence. That is, the frequency distribution of opinions has the same form for residents of the city and the suburbs. H 1 : Opinion is related to residence.

Steps (cont.) 2. Locate the critical region df = (# of columns - 1) (# of rows -1) = (2 - 1) (2 - 1) = 1 x 1 = 1 For df = 1 and α =.05, the critical 2 = 3.84

Steps (cont.) FavourOppose City 6832 Suburb 86114 Opinion Residence Row totals Column totals 154146 100 200 Cellfofe(fo-fe)(fo-fe) 2 (fo-fe) 2 /fe City favour 68 City oppose 32 Suburb favour 86 Suburb oppose 11 4

Steps (cont.) FavourOppose City 6832 Suburb 86114 Opinion Residence Row totals Column totals 154146 100 200 City frequencies fe favour = 154(100) / 300 = 51.33 fe oppose = 146(100) / 300 = 48.67 Suburb frequencies fe favour = 154(200) / 300 = 102.67 fe oppose = 146(200) / 300 = 97.33

Steps (cont.) Cellfofe(fo-fe)(fo-fe) 2 (fo-fe) 2 /fe City favour 6851.3316.67277.88895.4138 City oppose 3248.67-16.67277.88895.7097 Suburb favour 86102.67-16.67277.88892.7066 Suburb oppose 11497.3316.67277.88892.8551 2 = 5.4138 + 5.7097 + 2.7066 + 2.8551 = 16.69 3.Calculate chi-square statisic

Steps (cont.) 4. State a decision and conclusion Decision: Critical 2 = 3.84 Obtained 2 = 16.69 Therefore, reject Ho Conclusion (in APA format) Opinions in the city are different from those in the suburbs, 2 (1, n = 300) = 16.69, p <.05.

Steps (cont.) Part b) Phi-coefficient (effect size)? ɸ = √( 2 / N) = √(.0556 ) =.236 Therefore, it is a small effect.

Spearman Correlation What we know: n = 5 (that is, there are five X-Y pairs)

Step 1. Rank the X and Y Values X RANK Y RANK 2134521345 2143521435 The order of your X and Y values by increasing value

Step 2. Compute the correlation DD2D2 0 1 0 0011000110 X RANK Y RANK 2134521345 2143521435 2 = ΣD 2

Step 2. Cont. Using the Spearman formula, we obtain D2D2 r s = 1 - 6(2) 5(5 2 -1) = 1 - 12 5(24) = 1 - 12 120 = 1 -.1 = + 0.90

Mann-Whitney U AB

Steps What we know: n A = 6, n B = 6, α =.05 A B

Steps (cont.) 1. State the hypotheses: H o : There is no difference between the two treatments. H 1 : There is a difference between the two treatments.

Steps (cont.) 2. Locate the critical region For a non-directional test with α =.05, and n A = 6, and n B = 6, the critical U = 5.

Steps (cont.) Step 3: First: Identify the scores for treatment A Second: For each treatment A score, count how many scores in treatment B have a higher rank. Third: U A = the sum of the above points for Treatment A, therefore, U A = 6. Rank Score Sample Points for Treatment A 1 2 3 4 5 6 7 8 9 10 11 12 9 10 12 14 17 37 39 40 41 44 45 104 B B B B B A A A A A A B 1 1 1

Steps (cont.) Alternatively, U A can be computed based on the sum of the Treatment A ranks. This is a less tedious option for large samples. R A = 6 + 7 + 8 + 9 + 10 + 11 = 51 Computation continued on the next slide Rank Score Sample Points for Treatment A 1 2 3 4 5 6 7 8 9 10 11 12 9 10 12 14 17 37 39 40 41 44 45 104 B B B B B A A A A A A B 1 1 1

Steps (cont.) U A = n A n B + n B (n A +1) - R A 2 = 6(6) + 6(6+1) - 51 2 = 36 + 21 - 51 = 6 Rank Score Sample Points for Treatment A 1 2 3 4 5 6 7 8 9 10 11 12 9 10 12 14 17 37 39 40 41 44 45 104 B B B B B A A A A A A B 1 1 1

Steps (cont.) Since U A + U B = n A n B and we know U A = 6 U B can be derived accordingly… U B = n A n B - U A = 6(6) - 6 = 36 - 6 = 30 The smaller U value is the Mann-Whitney U statistic, so U = 6.

Steps (cont.) Step 4: Decision and Conclusion U = 6 is greater than the critical value of U = 5, therefore we fail to reject Ho. The treatment A and B scores were rank-ordered and a Mann-Whitney U-test was used to compare the ranks for Treatment A (n=6) and B (n=6). The results show no significant difference between the two treatments, U = 6, p >.05, with the sum of the ranks equal to 51 for treatment A and 27 for treatment B.

Wilcoxon Signed-Ranks Test

Steps DIFF. RANK POSITION -11 -2 -18 -7 4 -2 -14 -9 -5 1 Differences ranked from smallest to largest (in relation to 0) 8 3 10 6 4 2 9 7 5 1 FINAL RANK 8 2.5 10 6 4 2.5 9 7 5 1 Tied Diff. Use average of the ranks for the final rank (2+3)/2 = 2.5

Steps DIFF. 11 2 18 7 -4 2 14 9 5 FINAL RANK 8 2.5 10 6 4 2.5 9 7 5 1

Steps (cont.) 1. State the hypotheses: H o : There is no difference between the two treatments. H 1 : There is a difference between the two treatments.

Steps (cont.) 2. Locate the critical region For a non-directional test with α =.05, and n = 10, the critical T = 8. 3. Compute the sum of the ranks for the positive and negative difference scores: R + = 8+2.5+10+6+2.5+9+7+5 = 50 R - = 4+1 = 5 The Wilcoxon T is the smaller of these sums, therefore, T = 5.

Steps (cont.) 4. Decision and Conclusion T = 5 is less than the critical value of T = 8, therefore we reject Ho. The treatment I and II scores were rank-ordered by the magnitude in difference scores, and the data was evaluated using the Wilcoxon T. The results show a significant difference in scores, T = 5, p <.05, with the ranks for increases totalling 50, and for decreases totalling 5.

Download ppt "Stats 2020 Tutorial. Chi-Square Goodness of Fit Steps Age < 20Age 20-29Age ≥ 30 6892140 0.160.280.56 fofo pepe fefe What we know: n = 300, α =.05 and..."

Similar presentations