Download presentation
Presentation is loading. Please wait.
1
Analysis of Variance ANOVA
2
Partitioning Variance Framework
Let’s say I collected a random sample of 100 Women 100 Men --> measured height
4
TOTAL Variance
5
Total Variance = Variance due to group differences +
Variance due to differences within groups
6
Total
7
Among Group Within Group
8
Ratio of Among to Within
t value for the t-test
10
t = Among / Within = Small / Big = SMALL
Among Group Within Group
11
t = Among / Within = Big / Small = BIG
Among Group Within Group
12
Analysis of Variance: ANOVA
Comparing 3 or more means
13
Hypotheses Ho: A = B HA: A B
15
Hypotheses Ho: A = B = C ; all the means are equal HA: A B = C or A = B C --> at least one mean is different or A C = B A B C
16
t-test t-test t-test
17
Each of the t-tests has a 0
Each of the t-tests has a 0.05 chance (5%) of falsely rejecting the null hypothesis. So what is our TOTAL chance of falsely rejecting the hypothesis that the means are equal? t-test
18
--> a function of how many comparisons we do using a t-test.
# samples being compared 2 3 4 5 10 . # of comparisons 1 6 45 Probability of type I error (=0.05) 0.05 0.14 0.26 0.40 0.9
19
Variable 1 2 3 Group 3 Sources of variation
20
Variable 1 2 3 Group 1) Deviation of individual observations from the Grand Mean,
21
Variable 1 2 3 Group 2) Deviation of individual observations from their Group Mean,
22
Variable Group2 mean lies right on the grand mean in this instance, not always the case. 1 2 3 Group 3) Deviation of the Group Means from the Grand Mean,
23
Variable 1 2 3 Group Total Variation (1 above) in the data can be attributed to contributions made by variation of individual observations about their group mean (2 above) and variation of the groups about the grand mean (3 above).
24
Variable 1 2 3 Group To test whether group means are equal or not, we look at the ratio of variation due to group deviation from the grand mean to the variation of individual observations from their group mean. -> We usually refer to these as among and within group sources of variation
25
Variable 1 2 3 Group The first step in ANOVA is to calculate all of the pertinent sums of squares Total Among Group Within Group
26
Variable 1 2 3 Group The second step in ANOVA is to calculate all of the mean squares Total - don’t calculate, is equal to variance for all observations Among Group -> Among Group SS / Among Group DF Within Group -> Within Group SS/ Within Group DF
27
Variable 1 2 3 Group Degrees of Freedom for ANOVA Total -> total # of observations - 1 n1+n2+n3-1; eg above, 12-1=11 Among Group -> Number of groups -1 = k-1; eg above 3-1=2 Within Group -> Total # of observations - number of groups, N-k eg above 12-3=9
28
SSTotal = SSAmong + SSWithin
Variable 1 2 3 Group Aside SSTotal = SSAmong + SSWithin DFTotal = DFAmong + DFWithin
29
Variable 1 2 3 Group MSAmong = SSAmong / DFAmong MSWithinr = SSWithin / DFWithin F = MSAmong / MSWithin
30
Variable 1 2 3 Group MSAmong --> Big MSWithin--> Small F --> BIG Reject Ho
31
Variable 1 2 3 Group MSAmong --> Small MSWithin--> Big F --> SMALL Do NOT Reject Ho
32
Yields of corn under 4 fertilizer treatments
Control K+N K+P N+P Mean
35
p
36
ANOVA - testing for differences among means for various groups
--> a couple of ways that we could have come up with our groups 1) we can set them 2) we can determine them randomly
37
Fixed Effect ANOVA Model I
For example, let’s say that there are 26 different medications available to control blood pressure. Perhaps LHSC uses 4 of the: D, G, M, and P --> we want to test the effects of these specific drugs on blood pressure. --> assign patients to each drug randomly and monitor effect on blood pressure --> do ANOVA to test for differences among means Fixed Effect ANOVA Model I
38
Random Effect ANOVA Model II
Alternatively, we may be interested in variability among BP drugs in general --> select 4 at random from all 26 available --> do ANOVA to test for differences among means Random Effect ANOVA Model II
39
ANOVA, the next level So far --> looked at the effect of a single category on the response in some continuous variable smoking/non-smoking on neonatal birth weight various fertilizers on crop yield etc.
40
ANOVA also allows us to look at the effects of multiple factors on the response variable of interest
For example, in the blood pressure example above, --> we could have added the effects of gender as well 2-Factor ANOVA --> and the effect of race 3-factor ANOVA
41
2 Factor ANOVA Let’s say, --> look at the influence of drug and gender on BP Questions: What effect does DRUG have? What effect does GENDER have? Does DRUG have the same effect on each GENDER?
42
Hypotheses: Ho: D = G HA: D G Ho: male = female HA: male female Ho: the drugs effect males and females in the same way HA: the drugs effect males and females in different ways Main Effects Interaction
43
G D D G
44
G D D G
45
TOTAL SS DF = N-1
46
Cells SS kA* kB - 1 = ab - 1
47
Within Cells (Error) SS
DF = ab(n-1)
48
Factor A SS DF = a - 1
49
Factor B SS DF = b - 1
50
Interaction SS = Cells SS - Factor A SS - Factor B SS
DF = Cells DF - Factor A DF - Factor B SS
51
All MS’s are equal to SS divided by appropriate DF EG Factor A MS = Factor A SS / Factor A DF
52
? Source of Variation df SS MS F Total Cells Factor A Factor B A x B
Within Cells ?
53
Various F calculations - depend on what type of ANOVA.
Fixed --> Model I both factors are fixed Random --> Model II both factors are random Mixed model --> Model III one factor fixed and one factor random
54
Computation of F - statistics for Model I and III ANOVA
55
Model I - both factors are fixed
An Example A researcher is investigating the effect of three drug therapies (labeled 1, 2 and 3) on two different disorders (called depressives and schizophrenics) Model I - both factors are fixed 9 patients with each disorder (18 total) assigned randomly to each drug treatment (3 in each cell) Drug 1 Drug 2 Drug 3 Sch Dep
56
Sch Dep Drug Drug 2 Drug 3
57
Hypotheses: Drug Ho: There is no difference among drugs in Psych score change HA: There is a difference among drugs in Psych score change Disorder Ho: There is no difference among disorders in Psych score change HA: There is a difference among disorders in Psych score change Interaction: Ho: There is no difference in the way the disorders respond to the drugs HA: There is a difference in the way the disorders respond to the drugs
59
Examine the interaction term first!!!
ANOVA Results Effect df MS df MS (F/R) Effect Effect Error Error F p {1}VAR1 Fixed {2}VAR2 Fixed 1*2 Fixed Examine the interaction term first!!! < 0.05, therefore reject Ho, there is a significant interaction --> the two disorders respond differently to the two drug treatments If interaction significant, STOP
61
Hypotheses: Psychiatric Treatment (Factor A)
Ho: There is no difference in months to recovery among Psychiatric treatments HA: There is a difference in months to recovery among Psychiatric treatments Physical Therapy Treatment (Factor B) Ho: There is no difference in months to recovery among Physical Therapy treatments HA: There is a difference in months to recovery among Physical Therapy treatments Interaction (AxB) Ho: Physical Therapy treatments respond the same among the Psychiatric treatments HA: Physical Therapy treatments respond differently among the Psychiatric treatments
62
Reject Interaction Ho ANOVA Results: MONTHS (2way.sta)
Effect df MS df MS (F/R) Effect Effect Error Error F p {1}PSYCHTRT {2}PYSTHER 1* Reject Interaction Ho
64
Hypotheses: Pot Use Ho: There is no difference in maturity among Pot Usage groups HA: There is a difference in maturity among Pot Usage groups Age Ho: There is no difference in maturity among Age groups HA: There is a difference in maturity among Age groups Interaction Ho: The effect of Age on Maturity is the same among the Usage groups HA: The effect of Age on Maturity is NOT the same among the Usage groups
65
Do NOT reject Interaction Ho (p = 0.2182 > 0.05)
ANOVA Results: VAR10 (2way.sta) Effect df MS df MS (F/R) Effect Effect Error Error F p Use Fixed Age Fixed 1*2 Fixed Do NOT reject Interaction Ho (p = > 0.05) Reject Use Ho (p = < 0.05) Reject Age Ho (p= < 0.05)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.