Stats 2020 Tutorial

Post on 04-Jan-2016

33 views 1 download

description

Stats 2020 Tutorial. Chi-Square Goodness of Fit. f o. p e. f e. Steps. What we know: n = 300, α = .05 and... The observed number (f o ) and percentage of drivers in each category:. Steps (cont.). - PowerPoint PPT Presentation

Transcript of Stats 2020 Tutorial

Stats 2020 Tutorial

Chi-Square Goodness of Fit

Steps

Age < 20 Age 20-29 Age ≥ 30

68 92 140

0.16 0.28 0.56

fo

pe

fe

What we know:n = 300, α = .05

and...The observed

number (fo) and percentage of drivers in each

category:

Steps (cont.)

1.State the hypotheses:

Ho: The distribution of auto accidents is the same as the distribution of registered drivers.H1: 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 statisticfe = pn

Age < 20:.16(300) = 48

Age 20-29:.28(300) = 84

Age ≥ 30:.56(300) = 168

Age < 20 Age 20-29 Age ≥ 30

68 92 140

0.16 0.28 0.56

48 84 168

fo

pe

fe

Notice that for both the observed (fo) and expected (fe) frequency, that the sum of the frequencies should equal

n.

Steps (cont.)

Age < 20 Age 20-29 Age ≥ 30

68 92 140

0.16 0.28 0.56

48 84 168

fo

pe

fe

𝝌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.99Obtained 𝝌2 = 13.76Therefore, 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

Original Eyes farther Eyes closer

51 72 27

0.33 0.33 0.33

fo

pe

fe

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:

Ho: There is no preference among the three photographs.H1: 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 statisticfe = pn

Original:.3333(150) = 50

Eyes farther:.3333(150) = 50

Eyes closer:.3333(150) = 50

Original Eyes farther Eyes closer

51 72 27

0.33 0.33 0.33

50 50 50

fo

pe

fe

Steps (cont.)

𝝌2 = (51-50)2/50 (72-50)2/50 (27-50)2/50+ += .02 + 9.68 + 10.58= 20.28

Original Eyes farther Eyes closer

51 72 27

0.33 0.33 0.33

50 50 50

fo

pe

fe

Steps (cont.)4.State a decision and conclusion

Decision:Critical 𝝌2 = 5.99Obtained 𝝌2 = 20.28Therefore, 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, and200 are from the suburbs

Favour Oppose

City 68 32

Suburb 86 114

Opinion

Residence

Row totals

Column totals 154 146

100

200

That is, 68+86 = 154 That is, 86+114 = 200

Steps (cont.)

1.State the hypotheses:

Ho: Opinion is independent of residence. That is, the frequency distribution of opinions has the same form for residents of the city and the suburbs.H1: 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.)

Favour Oppose

City 68 32

Suburb 86 114

Opinion

Residence

Row totals

Column totals

154 146

100

200

Cell fo fe(fo-fe)

(fo-fe)2 (fo-fe)2/fe

City favour

68

City oppos

e32

Suburb

favour86

Suburb

oppose

114

Steps (cont.)

Favour Oppose

City 68 32

Suburb 86 114

Opinion

Residence

Row totals

Column totals

154 146

100

200

City frequenciesfefavour = 154(100) / 300 = 51.33feoppose = 146(100) / 300 = 48.67

Suburb frequenciesfefavour = 154(200) / 300 = 102.67feoppose = 146(200) / 300 = 97.33

Steps (cont.)Cell fo fe (fo-fe) (fo-fe)2 (fo-fe)2/fe

City favour

68 51.33 16.67277.888

95.4138

City oppose

32 48.67 -16.67277.888

95.7097

Suburb favour

86102.6

7-16.67

277.8889

2.7066

Suburb oppose

114 97.33 16.67277.888

92.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.84Obtained 𝝌2 = 16.69Therefore, 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

XRANK YRANK

21345

21435

The order of your X and Y values by increasing value

Step 2. Compute the correlation

D D2

00-110

00110

XRANK YRANK

21345

21435

2 = ΣD2

Step 2. Cont.Using the Spearman formula, we obtain

D2

rs = 1 - 6(2)5(52-1)

= 1 - 125(24)

= 1 - 12120

= 1 - .1 = + 0.90

Mann-Whitney U

A B

StepsWhat we know:

nA = 6, nB = 6, α = .05

A B

Steps (cont.)

1.State the hypotheses:

Ho: There is no difference between the two treatments.H1: There is a difference between the two treatments.

Steps (cont.)2.Locate the critical region

For a non-directional test with α = .05, andnA = 6, and nB = 6, the critical U = 5.

Steps (cont.)

Step 3:First: Identify the scores for treatment ASecond: For each treatment A score, count how many scores in treatment B have a higher rank.Third: UA = the sum of the above points for Treatment A, therefore, UA = 6.

RankScoreSamplePoints for Treatment A

1 2 3 4 5 6 7 8 9 10 11 129 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 1 1 1

Steps (cont.)

Alternatively, UA can be computed based on the sum of the Treatment A ranks. This is a less tedious option for large samples.

𝚺 RA = 6 + 7 + 8 + 9 + 10 + 11 = 51

Computation continued on the next

slide

RankScoreSamplePoints for Treatment A

1 2 3 4 5 6 7 8 9 10 11 129 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 1 1 1

Steps (cont.)

UA = nAnB +nB(nA+1)- 𝚺 RA

2

= 6(6) + 6(6+1) - 512

= 36 + 21 - 51

= 6

RankScoreSamplePoints for Treatment A

1 2 3 4 5 6 7 8 9 10 11 129 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 1 1 1

Steps (cont.)Since

UA + UB = nAnB

and we know UA = 6UB can be derived

accordingly…

UB = nAnB - UA

= 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-74-2

-14-9-51

Differences ranked from smallest to

largest (in relation to 0)

83

106429751

FINAL RANK

82.51064

2.59751

TiedDiff.

Use average of the ranks for the final

rank(2+3)/2 = 2.5

Steps

DIFF.

112

187-42

1495-1

FINAL RANK

82.51064

2.59751

Steps (cont.)

1.State the hypotheses:

Ho: There is no difference between the two treatments.H1: There is a difference between the two treatments.

Steps (cont.)2.Locate the critical region

For a non-directional test with α = .05, andn = 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.