Skewness. Assumptions of t-test t test and ANOVA. 1. Normality. Both t-test and ANOVA require your data to fit a distribution that is normal

Assumptions of tt-test and ANOVA Skewness 1. Normality Both t-test and ANOVA require your data to fit a distribution that is normal. Kurtosis Ass...
Author: Jacob Terry
41 downloads 0 Views 123KB Size
Assumptions of tt-test and ANOVA

Skewness

1. Normality

Both t-test and ANOVA require your data to fit a distribution that is normal.

Kurtosis

Assumptions of tt-test and ANOVA 2. Homogeneity of Variance (Equal variance). Both t-test and ANOVA require your samples to have equal variance. 74

70

66

62

58

54

50

46

Assumptions of tt-test and ANOVA 3. Independent observations. More of an experimental design issue than an analysis issue but very important. For example, Monoxidil experiment...

1

2

Departures from Normality. --> there are specific tests determine if your data are normal or not. However, the tests are not that good. Luckily, t-test and ANOVA do just fine if this assumption is not violated too badly. So, use your eye to determine if normal or not

1

Heterogeneity of Variance.

Variance Ratio Test

Again, t-test and ANOVA are relatively robust to violation of the Equal variance assumption

Ho: σA2 = σB2

--> provided sample sizes are the same for all of your groups. What to do. t-test --> do a Variance Ratio Test

F=

s 2A sB2 or sB2 s A2

Depending on whether var A is larger or if var B is larger

Ho: σA2 ≠ σB2 Two samples, A and B Sample size 12 and 10 respectively and variance 45 and 32 respectively. s 2 45 Fobserved = 2A = = 1.406 sB 32

F0.05( 2 ),12 ,10 = 3.62 Therefore, do not reject Ho, the variances are equal

For ANOVA, probably ok most of the time.

Effects of Non-normality on your analysis:

--> particularly true if sample with biggest variance also has biggest sample size

Inflate your probability of error (Types I and II)

--> however, if other way round, big variance and small sample size - may want to do something besides ANOVA.

Analyses we’ve discussed so far are robust to non-normality BUT, sometimes just too much departure…. Then what?

Transform your data NonNon-parametric methods for comparing samples --> do not require the estimation of population mean and variance --> do not require normality --> do not require homogeneity of variance

2

Parametric test

Non-parametric test

The Mann-Whitney Test for comparing 2 samples

2 samples

t-test

Mann-Whitney

paired samples

paired t-test

Wilcoxon

Hypotheses: Ho: the two samples are the same

3 or more samples

ANOVA

Kruskal-Wallace

HA: the two samples are not the same Each observation --> assigned a rank from largest to smallest

Deal with Means and Variances

- include observations from both samples Deal with Ranks

For example, suppose we had two samples of mice given different levels of growth hormone and we wanted to compare the number of days until adult weight is attained. Group 1 152 148 136 158 162

Group 1 152 148 136 158 162

Group 2 155 168 162 168 169

For example, suppose we had two samples of mice given different levels of growth hormone and we wanted to compare the number of days until adult weight is attained. Group 1 152 148 136 158 162

U = n1n2 +

Rank 8 9 10 6 4 37

n1 ( n1 + 1) − R1 2

Group 2 155 165 161 168 169

U ′ = n2 n1 +

For example, suppose we had two samples of mice given different levels of growth hormone and we wanted to compare the number of days until adult weight is attained.

Rank 7 3 5 2 1 18

n2 ( n2 + 1) − R2 2

Rank 8 9 10 6 4

Group 2 155 165 161 168 169

Rank 7 3 5 2 1

n1( n1 + 1) − R1 2 5( 6 ) = 5*5 + − 37 = 25 + 15 − 37 2 =3

U = n1n2 +

n2 ( n2 + 1) − R2 2 5* 6 = 5*5 + − 18 = 25 + 15 − 18 2 = 22

U ′ = n2 n1 +

3

If either U or U’ is greater than the critical value of U, then you should reject the Ho Critical value of U:

U= 3 and U’ = 22, therefore, do not reject Ho

U Critical = U 0.05,( 2 ),n1 ,n2

U Critical = U 0.05,( 2 ),n2 ,n1

if n1 < n2

if n1 > n2

One-tailed Mann-Whitney U test.

Dealing With Tied Ranks For example, suppose we had two samples of mice given different levels of growth hormone and we wanted to compare the number of days until adult weight is attained. Group 1 152 148 136 160 162

Rank 8 9 10 6 3.5

(3+4)/2=3.5 (5+6+7)/3=6

Group 1 152 148 136 160 162

Group 2 160 162 160 168 169

Rank 6 3.5 6 2 1

Assign ranks then proceed as in previous example

Rank 8 9 10 6 3.5

H o: G 1 ≥ G 2 HA: G1< G2

n2 ( n2 + 1) − R2 2 5* 6 = 5*5 + − 18 = 25 + 15 − 18.5 2 . = 215

U ′ = n2 n1 +

U Critical = U 0.05,( 2 ),n1 ,n2 = U 0.05,( 2 ),5,5 = 23

Group 2 160 162 160 168 169

Rank 6 3.5 6 2 1 18.5

U 0.05,(1),5,5 = 21 ∴Reject Ho

Use U or U’ depending on whether you expect sample 1 or sample 2 to be bigger

Ho: G1 ≥ G2 HA: G1 < G2

Ho: G1 ≤ G2 HA: G1 > G2

Ranking is low to high

U

U’

Ranking is high to low

U’

U

Wilcoxon paired sample test --> set-up same as paired sample t-test --> calculate the difference between two measurements Deer 1 2 3 4 5 6 7 8 9 10

Front Leg 142 140 144 144 142 146 149 150 142 148

Back Leg 138 136 147 139 143 141 143 145 136 146

Diff 4 4 -3 5 -1 5 6 5 6 2

Rank |d|

Signed Rank |d|

4

Next, assign ranks to the absolute values (low to high) of the differences, and then assign the corresponding sign to the rank Deer 1 2 3 4 5 6 7 8 9 10

Front Leg 142 140 144 144 142 146 149 150 142 148

Back Leg 138 136 147 139 143 141 143 145 136 146

Rank |d| 4.5 4.5 3 7 1 7 9.5 7 9.5 2

Diff 4 4 -3 5 -1 5 6 5 6 2

Signed Rank |d| 4.5 4.5 -3 7 -1 7 9.5 7 9.5 2

Sum the positive ranks - T+ = 51 Sum the negative ranks - T- = 4

If either T+ or T- is less than or equal to T0.05, (2),n then reject Ho

T0.05, (2),10 = 8 > T- = 4, so reject Ho

Sum the positive ranks - T+ = 51 Sum the negative ranks - T- = 4

KruskalKruskal-Wallis test Yields of corn under 4 fertilizer treatments

Can also do these one tailed: Ho: Measurement 1 ≤ Measurement 2 HA: Measurement 1 > Measurement 2

Control 40 (1) 61 (4) 72 (8.5) 76 (10) 84 (15.5) 99 (21.5) 6 60.5

--> reject Ho if T- ≤ T0.05, (1),n

Ho: Measurement 1 ≥ Measurement 2 HA: Measurement 1 < Measurement 2

n R

--> reject Ho if T+ ≤ T0.05, (1),n

K+N 82 (14) 84 (15.5) 96 (20) 99 (21.5) 104 (23) 105 (23) 6 117

K+P 57 (2) 59 (3) 63 (5) 64 (6) 72 (8.5) 81 (13) 6 37.5

N+P 71 (7) 78 (11) 79 (12) 87 (17) 91 (18) 92 (19) 6 84

Yields of corn under 4 fertilizer treatments

n R

Control 40 (1) 61 (4) 72 (8.5) 76 (10) 84 (15.5) 99 (21.5) 6 60.5

H=

K+N 82 (14) 84 (15.5) 96 (20) 99 (21.5) 104 (23) 105 (24) 6 117 k

K+P 57 (2) 59 (3) 63 (5) 64 (6) 72 (8.5) 81 (13) 6 37.5

N+P 71 (7) 78 (11) 79 (12) 87 (17) 91 (18) 92 (19) 6 84

H=

k Ri2 12 − 3( N + 1) ∑ N ( N + 1) i=1 ni

12 60.52 + 1172 + 37.52 + 842 − 3( 25) 24( 25) = 0.02(3660.25 + 13689 + 1406.25 + 7056 ) − 75 = 516.23 − 75 =

(

)

. = 44123

2 i

R 12 ∑ − 3( N + 1) N ( N + 1) i=1 ni

5

Correction factor for tied ranks

C = 1−

∑t

N3 − N 18 = 1− 3 24 − 24 = 1 − 0.0013

Critical value: m

∑t = ∑t

3 i

− ti

i =1

= 23 − 2 + 23 − 2 + 23 − 2 = 18

= 0.9987

Hc =

χ 20.05,k −1 = χ 20.05,3 = 7.815

H C > χ 20.05,3 Reject Ho

H 44123 . = = 44180 . C 0.9987

6

Suggest Documents