21
Analysis of variance Analysis of variance (3) (3)

Analysis of variance (3). Normality Check Frequency histogram (Skewness & Kurtosis) Probability plot, K-S test Normality Check Frequency histogram (Skewness

  • View
    244

  • Download
    6

Embed Size (px)

Citation preview

Page 1: Analysis of variance (3). Normality Check Frequency histogram (Skewness & Kurtosis) Probability plot, K-S test Normality Check Frequency histogram (Skewness

Analysis of variance (3)Analysis of variance (3)

Page 2: Analysis of variance (3). Normality Check Frequency histogram (Skewness & Kurtosis) Probability plot, K-S test Normality Check Frequency histogram (Skewness

Normality CheckFrequency histogram

(Skewness & Kurtosis)Probability plot, K-S test

Normality CheckFrequency histogram

(Skewness & Kurtosis)Probability plot, K-S test

Descriptive statistics

Descriptive statistics

Measurements(data)

Measurements(data)

Mean, SD, SEM, 95% confidence interval

Mean, SD, SEM, 95% confidence interval

YES

Check the Homogeneity of Variance

Check the Homogeneity of Variance

Data transformation

Data transformation

NO

Data transformation

Data transformation

NO

Median, range, Q1 and Q3

Median, range, Q1 and Q3

Non-ParametricTest(s) For 2 samples: Mann-WhitneyFor 2-paired samples: Wilcoxon For >2 samples:Kruskal-WallisSheirer-Ray-Hare

Non-ParametricTest(s) For 2 samples: Mann-WhitneyFor 2-paired samples: Wilcoxon For >2 samples:Kruskal-WallisSheirer-Ray-Hare

Parametric TestsStudent’s t tests for 2 samples; ANOVA for 2 samples; post hoc tests for multiple comparison of means

Parametric TestsStudent’s t tests for 2 samples; ANOVA for 2 samples; post hoc tests for multiple comparison of means

YES Multi-way ANOVA (Ch 14)Multi-way ANOVA (Ch 14)Nested ANOVA (Ch 15)Nested ANOVA (Ch 15)

e.g. Fe.g. F maxmax test test

FriedmanFriedmanp. 263-265p. 263-265

Non-parametric Repeated-measures ANOVA

Univariate ANOVAOnly one dependent variable

Non-parametric 2-way ANOVA with replication

Page 3: Analysis of variance (3). Normality Check Frequency histogram (Skewness & Kurtosis) Probability plot, K-S test Normality Check Frequency histogram (Skewness

Multi-way ANOVAMulti-way ANOVA Effects of sex and water temperature on the oxygen

consumption rate of three species of inter-tidal crabs

Page 4: Analysis of variance (3). Normality Check Frequency histogram (Skewness & Kurtosis) Probability plot, K-S test Normality Check Frequency histogram (Skewness

Multi-way ANOVAMulti-way ANOVA

• e.g. We would like to investigate the effects of sex and temperature (10, 20, 30C) on oxygen consumption rate (OC; mg O2/hr/individual) of three different species of crabs of similar size

• Dependent variable = OC• 3-Factors = Species (3 levels), Sex (2 levels) and

Temperature (3 levels)• 4 Replicates per group (balanced design), thus• Total N = 3 x 2 x 3 x 4 = 72

Page 5: Analysis of variance (3). Normality Check Frequency histogram (Skewness & Kurtosis) Probability plot, K-S test Normality Check Frequency histogram (Skewness

Low temperature Med. temperature High temperature

Species Male Female Male Female Male Female

A 1.9 1.8 2.3 2.4 2.9 3.01.8 1.7 2.1 2.7 2.8 3.11.6 1.4 2.0 2.4 3.4 3.01.4 1.5 2.6 2.6 3.2 2.7

B 2.1 2.3 2.4 2.0 3.6 3.12.0 2.0 2.6 2.3 3.1 3.01.8 1.9 2.7 2.1 3.4 2.82.2 1.7 2.3 2.4 3.2 3.2

C 1.1 1.4 2.0 2.4 2.9 3.21.2 1.0 2.1 2.6 2.8 2.91.0 1.3 1.9 2.3 3.0 2.81.4 1.2 2.2 2.2 3.1 2.9

The oxygen consumption rate (mg O2/hr/individual) of the crabs

Page 6: Analysis of variance (3). Normality Check Frequency histogram (Skewness & Kurtosis) Probability plot, K-S test Normality Check Frequency histogram (Skewness

0.0

0.5

1.0

1.5

2.0

2.5

3.0

3.5

4.0

LT (M) LT (F) MT (M) MT (F) HT (M) HT (F)

OC

R (

mg

ox

yge

n/h

r/in

d.)

0.0

0.5

1.0

1.5

2.0

2.5

3.0

3.5

4.0

LT (M) LT (F) MT (M) MT (F) HT (M) HT (F)

OC

R (

mg

ox

yge

n/h

r/in

d.)

0.0

0.5

1.0

1.5

2.0

2.5

3.0

3.5

LT (M) LT (F) MT (M) MT (F) HT (M) HT (F)

OC

R (

mg

ox

yge

n/h

r/in

d.)

Species A

Species C

Species B

Page 7: Analysis of variance (3). Normality Check Frequency histogram (Skewness & Kurtosis) Probability plot, K-S test Normality Check Frequency histogram (Skewness

Data input in SPSS

• Column 1 (Species): 1, 2, 3• Column 2 (Temp): 1, 2, 3• Column 3 (Sex): 1, 2• Column 4 (OC): dependent variable• Model or effects in hypothesis:

– Species– Temp– Sex– Species Temp– Species Sex– Temp Sex– Species Temp Sex

Page 8: Analysis of variance (3). Normality Check Frequency histogram (Skewness & Kurtosis) Probability plot, K-S test Normality Check Frequency histogram (Skewness

Computer Output

There is no critical values in Table B4 for d.f. = 54, so the values for the next lower d.f. = 50 were utilized.

Source of variation SS DF MS F Critical F P Conclusion

Species 1.818 2 0.909 24.475 3.180 < 0.001 Reject HoTemp 24.656 2 12.328 332.020 3.180 < 0.001 Reject HoSex 0.009 1 0.009 0.239 4.050 > 0.50 Accept HoSpecies x Temp 1.102 4 0.275 7.418 2.560 < 0.001 Reject HoSpecies x Sex 0.370 2 0.185 4.986 3.180 < 0.025 Reject HoTemp x Sex 0.175 2 0.088 2.360 3.180 > 0.10 Accept HoSpecies x Temp x Sex 0.221 4 0.055 1.485 2.560 > 0.10 Accept HoError 2.005 54 0.037

How to obtain the DF?

Page 9: Analysis of variance (3). Normality Check Frequency histogram (Skewness & Kurtosis) Probability plot, K-S test Normality Check Frequency histogram (Skewness

Computer Output

Source of variation SS DF MS F Critical F P Conclusion

Species 1.818 2 0.909 24.475 3.180 < 0.001 Reject HoTemp 24.656 2 12.328 332.020 3.180 < 0.001 Reject HoSex 0.009 1 0.009 0.239 4.050 > 0.50 Accept HoSpecies x Temp 1.102 4 0.275 7.418 2.560 < 0.001 Reject HoSpecies x Sex 0.370 2 0.185 4.986 3.180 < 0.025 Reject HoTemp x Sex 0.175 2 0.088 2.360 3.180 > 0.10 Accept HoSpecies x Temp x Sex 0.221 4 0.055 1.485 2.560 > 0.10 Accept HoError 2.005 54 0.037

In conclusion, the oxygen consumption rates (OCR) of the three species are not the same; and OCR increase with temperate. Furthermore, OCR of a species is dependent on temperature and sex as indicated by the significant interactions.

Page 10: Analysis of variance (3). Normality Check Frequency histogram (Skewness & Kurtosis) Probability plot, K-S test Normality Check Frequency histogram (Skewness

0.0

0.5

1.0

1.5

2.0

2.5

3.0

3.5

4.0

LT (M) LT (F) MT (M) MT (F) HT (M) HT (F)

OC

R (

mg

ox

yge

n/h

r/in

d.)

0.0

0.5

1.0

1.5

2.0

2.5

3.0

3.5

4.0

LT (M) LT (F) MT (M) MT (F) HT (M) HT (F)

OC

R (

mg

ox

yge

n/h

r/in

d.)

Species A

Species C

Species B

0.0

0.5

1.0

1.5

2.0

2.5

3.0

3.5

4.0

LT (M) LT (F) MT (M) MT (F) HT (M) HT (F)

OC

R (

mg

ox

yge

n/h

r/in

d.)

Remember to double check your ANOVA results against the figures!

Page 11: Analysis of variance (3). Normality Check Frequency histogram (Skewness & Kurtosis) Probability plot, K-S test Normality Check Frequency histogram (Skewness

Number of hypotheses potentially testable in ANOVA

Number of factors

2 3 4 5Main factor 2 3 4 52-way interactions 1 3 6 103-way interactions 1 4 104-way interactions 1 155-way interactions 1

Page 12: Analysis of variance (3). Normality Check Frequency histogram (Skewness & Kurtosis) Probability plot, K-S test Normality Check Frequency histogram (Skewness

Exercises – Please try to do these exercises at home or on this coming Computer lab

• Chapter 14 (Zar 1999)

• Page 301-2: Questions 14.4, 14.5 and 14.6

Page 13: Analysis of variance (3). Normality Check Frequency histogram (Skewness & Kurtosis) Probability plot, K-S test Normality Check Frequency histogram (Skewness

Nested (Hierarchical) ANOVAChapter 15

• In some experimental designs, we may have – some levels of one factor occurring in

combination with the levels of one or more other factors, and other distinctly different levels occurring in combination with others.

– e.g. testing the influence of drugs (3 types) on the blood cholesterol level in women while the drugs are produced by different sources (2 company)

Page 14: Analysis of variance (3). Normality Check Frequency histogram (Skewness & Kurtosis) Probability plot, K-S test Normality Check Frequency histogram (Skewness

Nested (Hierarchical) ANOVA

• e.g. testing the influence of drugs (3 types) on the blood cholesterol level in women while the drugs are originated from different sources

– Each drug obtained from 2 sources but the 2 sources were different for all the drugs

– Two factors: drug type and drug source

– Nested design: with one factor (drug source) being nested within the major factor (drug type)

Page 15: Analysis of variance (3). Normality Check Frequency histogram (Skewness & Kurtosis) Probability plot, K-S test Normality Check Frequency histogram (Skewness

• The nested factor is typically random (as this example)

• This example may be considered to be a kind of one-way ANOVA, however, a different denominator (i.e. not the error MS), subgroups MS, must be used to calculate the F value for the main factor (i.e. drug type).

Drug X Drug Y Drug Z

Source A B C D E F

Test Ho: Same blood cholesterol concentrations

Page 16: Analysis of variance (3). Normality Check Frequency histogram (Skewness & Kurtosis) Probability plot, K-S test Normality Check Frequency histogram (Skewness

Drug 1 Drug 2 Drug 3

Source A B C D E F

102 103 108 109 104 105104 104 110 108 106 107

n 2 2 2 2 2 2Sum Xi 206 207 218 217 210 212

Sum(Sum Xi)^2 21218 21424.5 23762 23544.5 22050 22472 134471 All sub-groupsSum Xi^2 21220 21425 23764 23545 22052 22474 134480 Total

Drug 1 Drug 2 Drug 3102 108 104104 110 106103 109 105104 108 107

n 4 4 4 SumSum Xi 413 435 422 1270

(Sum Xi)^2 42642.3 47306.3 44521.0 134469.5 All groupsSum Xi^2 42645.0 47309.0 44526.0 134480.0 Total

C = (1270)2/12 = 134408.33

Total SS = 134480 - 134408.33 = 71.67

Among all subgroups SS = 134471 - 134408.33 = 62.67

Error SS = Total SS – among all subgroups SS = 71.67 – 62.67 = 9.00

Groups SS = 134469.5 – 134408.33 = 61.17

Subgroups SS = among all subgroups SS – groups SS = 62.67 =61.17 = 1.50

Page 17: Analysis of variance (3). Normality Check Frequency histogram (Skewness & Kurtosis) Probability plot, K-S test Normality Check Frequency histogram (Skewness

a = 3 [3 drugs] b = 2 [2 sources]

Total DF = N - 1 = 12 – 1 = 11

Among all subgroups DF = ab –1 = (3)(2) – 1 = 5

Error DF = Total – among all subgroups = 11 –5 = 6

Groups SS = 3 – 1 = 2

Subgroups SS = a(b-1) = 3(2-1) = 3

Source of Variation SS DF MS F Critical F P

Total 71.67 11Among all subgroups 62.67 5Groups (drug type) 61.17 2 30.58 30.58/0.5 = 61.16 9.55 0.004Subgroups (drug source) 1.50 3 0.50 0.50/1.5 = 0.33 4.76 0.800Error 9.00 6 1.50

Using subgroups MS as the denominator

In conclusion, (1) there is no significant difference among the drug sources in affecting blood cholesterol concentrations (F0.05(1), 3, 6 = 4.76, P > 0.5) ; and (2) there is significant difference in cholesterol concentrations owing to the three drugs (F0.05(1), 2, 3 = 9.55, P < 0.01).

Page 18: Analysis of variance (3). Normality Check Frequency histogram (Skewness & Kurtosis) Probability plot, K-S test Normality Check Frequency histogram (Skewness

Example 15.2 (p. 309; Zar 1999) ANOVA with a random-effects factor (blood collection) nested within the two-factor crossed experimental design

• Effects of sex and hormone treatment on plasma calcium concentrations (mg/ 100 ml) of birds:

• For each of the 4 combinations of sex and hormone treatment (a = 2 & b =2), there are 5 animals (c = 5), from each of which three blood collections are taken (n = 3).

• N = abcn = 60

Page 19: Analysis of variance (3). Normality Check Frequency histogram (Skewness & Kurtosis) Probability plot, K-S test Normality Check Frequency histogram (Skewness

Example 15.2 (p. 309, Zar, 1999) ANOVA with a random-effects factor (blood collection) nested within the two-factor crossed experimental design

Source of Variation DF F

Total N - 1 = 59Sex (factor A) a - 1 = 1 factor A MS/ factor C MSHormone treatment (factor B) b - 1 = 1 factor B MS/ factor C MSA x B (a-1)(b-1) = 1 factor A x B MS/ factor C MSAmong all animals abc - 1 = 19Cells ab - 1 = 3Animals (within cells) (factor C) ab(c - 1) = 16 factor C MS/ Error MS

Error (within animals) abc(n-1) = 40

Page 20: Analysis of variance (3). Normality Check Frequency histogram (Skewness & Kurtosis) Probability plot, K-S test Normality Check Frequency histogram (Skewness

Exercise• In an experiment on cholesterol level in blood of mice two

levels of fat intake are fixed by the researchers and coded as level 0 and 1. For each level of intake, there are three populations of mice in separate cages and from each of these individual mice are selected at random for blood testing.

Fat intake Fat intake0 0 0 1 1 1

Cage CageMice 1 2 3 4 5 6

1 55.6 62.5 58.9 85.6 68.5 65.62 62.5 68.3 54.2 98.2 69.3 71.03 68.2 58.2 63.5 75.1 88.2 78.3

Page 21: Analysis of variance (3). Normality Check Frequency histogram (Skewness & Kurtosis) Probability plot, K-S test Normality Check Frequency histogram (Skewness

Other example