Introduction to Analysis of Variance Chapter 11
Review t-tests Single-sample t-test Independent samples t-test Related or paired-samples t-test s m M t ) ( 1 1 ) ( m m s M M t M D D D s M t n s s M 1 ) ( N M X S 1 1 ( ) 1 n s n s s M M N s s D M D 1 ) ( N M D S D D n s s M 1 ) ( N M X S
Which test do I use? What is the DV? What is the IV? What factor designates the groups? What and how many levels make up the factor Is it a between or within subject design? How many groups of subjects? How many measures for each subject? Which t-test do you use?
What type of t-test? What is the DV? IV? What design is used (between or within-ss)? A newspaper article reported that the typical American family spent an average of $81 on Halloween candy and costumes last year. You are interested in finding out if families in Spartanburg spend more or less than the national average. A researcher would like to replicate a study that found that older adults that owned pets were less likely to go to the doctor after an upsetting event than those who did not own pets. She would like to compare a group of pet owners to a group of people without pets and measure the number of visits to the doctor per year.
Method: Compare multiple groups A -level design may be too simple to answer the research question Beins et al. (007) Present cartoons to Ss after told to expect something that was either Not very funny Very funny No message about how funny to expect Results: Ratings of jokes depended on what people were expecting What are the benefits of the design?
ANOVA: Analysis of Variance How can we compare 3 or more levels at same time? Single-factor or One-way ANOVA Between subject design 1 factor or IV but + levels Example DV = # colds IV = drug type 3 levels bet-ss: placebo, low dose, high dose of vitamin C H : Null hypothesis: no difference between means Alternative hypothesis: difference between means H 1 Examine VARIANCE instead of sample mean difference S ( X M ) N 1 0 1 3 : 1 3
Why use ANOVAs? If =.05 for each t-test you compute Each test, 5% chance of type I error or 1 in 0 tests expect error If need multiple t-tests error Calculate chance of making Type I error: 1-(1-α) c Where c is number of comparisons 1-(1-.05) 3 = 1 (.95) 3 =.14 = 14% chance! Bonferroni adjustment: divide alpha by # tests Instead perform all tests simultaneously in ANOVA
ANOVA test statistic T-test ratio: t difference between sample means difference expected by chance F-ratio (ANOVA): F variance differences between sample means variance difference expected by chance (error)
Logic of ANOVA Separates total variability in the DV into two parts Between-treatments variability Systematic variance = diff s in means due to the IV (treatment effect) with error variance Within-treatments variability Error variance
group Between-Treatment Variance 3 X 3 1 X 4 Includes systematic variance plus error variance 1 X1 0 5 10 15 rating
group Within-Treatment Variance 3 SS3 SS 18 1 SS1 SS SS SS SS within 0 5 10 15 rating 1 3 SS 18 within
Logic of ANOVA Separates total variability in the DV into two parts Between-treatments variability Systematic variance = diff s in means due to the IV (treatment effect) with error variance Within-treatments variability Error variance Need to calculate Sum of Squares = SS Sum of squared deviations from each score from mean (X M) Note: if you then divide by N-1 you get variance (s )! Right?! Note: and then if you take square root you get standard deviation (s)! Right?!
Overall goal of ANOVA Evaluate difference between groups Distinguish if between-treatment differences due to: Treatment effect Chance or Error Inter-Individual differences between subject Intra-Individual differences within subject
ANOVA: Partitions the Variance Total Variance Between Treatment Variance Within Treatment Variance 1. Treatment effects. Error F = Between variance ---------------------- Within variance Error
The Analysis of Variance: The F-statistic Analysis of variance (ANOVA) looks at the ratio: F= variation among sample means variation among individuals in the same sample F= Treatment Effect +differences due to chance differences due to chance If there is no treatment effect, what would you expect for the value of F? 0 +differences due to chance F= differences due to chance = 1 = no effect
The Analysis of Variance F-statistic Analysis of variance (ANOVA) looks at the ratio: F= variation among sample means variation among individuals in the same sample F= Treatment Effect +differences due to chance differences due to chance If there IS a treatment effect, what would you expect for the value of F? Error term >0 +differences due to chance F= differences due to chance = >1 = an effect!
ANOVA formulas MS B = MS W = SS = sums of squares
Dogs, friends and stress 45 people were asked do a stressful task and their HR was measured 15 were randomly assigned to one of three groups Group 1 Group Group 3 Alone With a friend With their dog
Results What are hypotheses? H : 0 1 3 H : not all of,,and are equal A 1 3 X SS Group 1 Group Group 3 Alone With a friend With their dog 85.5 1184 91.3 964.05 73.4 137 We cannot use the t-test, because there are more than samples to be compared. So, use ANOVA
The ANOVA X S Group 1 Group Group 3 Alone With a friend With their dog 85.5 91.3 73.4 9. 8.3 9.9.05 Between Group Variance = 1194 Within Group Variance = 84.9 F = 14.1
Conclusion? Is there evidence that the level of stress differs among the experimental groups? 1. Determine correct df. Determine the critical F 3. Are the mean differences statistically significant?
ANOVA formulas: df Total df = N 1 Total = df within + df between Within df = (n 1) or = N k Total number of subjects number of groups or levels Between df = k 1 Number of groups or levels - 1
ANOVA formulas: df Total df = N 1 Within df = (n 1) or = N k Between df = k 1 (where k = # grps or levels) Total = df within + df between Dog example: 45 people; 15 per condition Total = 45 1 = 44 Within = (15-1)+(15-1)+(15-1) = 4 OR Within = 45 3 = 4 Between = 3 1 = Total = 4 + = 44 LOOK UP in table: Between (numerator) and within (denominator) df
DF within Critical F Table A.8 pp. 39-394 DF between
t distribution for df = 18 F-ratios distribution for df = 1, 18. Notice that the critical values for =.05 are t = ±.101 and that F =.101 = 4.41
Critical F Calculate between df and within df Ex: between =, within = 4 Look up critical F @.05 = 3.3, @.01 = 5.18 What is conclusion if: F (, 4) = 14.1 Write-up A one-way ANOVA was conducted to examine the effect of emotional support on heart rate. A significant difference in HR was found between the groups that dealt with a stressful event alone (M = 85.5, SD = 9.), with a friend (M = 91.3, SD = 8.3), and with a dog (M = 73.4, SD = 9.9), F(, 4) = 14.1, p <.01.
Anova: Definitional formulas Between groups SS (sums of squares) Sum of squared deviations from each group s mean from grand mean multiplied by the number of Ss in group Within groups SS Sum of squared deviations of each score from group mean Total SS [( M M Sum of squared deviations of each score from the grand mean ( X MG) g G ( X M g ) ) n ]
ANOVA (theoretical) formulas: SS Total SS = = 46 Within SS = = 16 Between SS = = 30 ( X MG) ( X M g ) [( M M SS total = SS between + SS within 46 = 30 + 16 g G ) n ] Temp Cond 1 3 0 4 1 X = 1 3 106 3 6 G=30 1 3 0 N=15 0 4 0 k=3 T 1 =5 T =0 T 3 =5 M G = SS 1 =6 SS =6 SS 3 =4 n 1 =5 n =5 n 3 =5 M 1 =1 M =4 M 3 =1
ANOVA computational formulas: Sum of Squares (SS) Total SS: sum of squared deviations from grand mean G SS TOTAL X N Within SS = SS = sum of squared deviations from grp mean SS Within Between SS = sum of squared deviations of grp mean from grand mean T G SS between n N SS total = SS between + SS within Where G = grand (overall) sum of scores Where N = total number of scores ( X M g ) ( X M ) ( 1 g X M g 3 Where T = sum of scores for group Where n = number of scores in group )
ANOVA formulas: SS Total SS = = 106 30 /15 = 46 Within SS = SS = 6 + 6 + 4 = 16 Between SS = SS X = 5 /5 + 0 /5 + 5 /5 30 /15 = 30 SS total = SS between + SS within 46 = 30 + 16 T n G N SS between G N Temp Cond 1 3 0 4 1 X = 1 3 106 3 6 G=30 1 3 0 N=15 0 4 0 k=3 T 1 =5 T =0 T 3 =5 SS 1 =6 SS =6 SS 3 =4 n 1 =5 n =5 n 3 =5 M 1 =1 M =4 M 3 =1
ANOVA formulas MS between SS df between between MS between 30 15 MS within SS df within within MS within 16 1 1.33 MS between F F 11. 8 MS within 15 1.33
ANOVA summary table Source df SS MS F Between 30 15 11.8* Within 1 16 1.33 Total 14 46 * Significant at.01 level F (, 1) = 11.8, p <.01
Effect size How much of the variability in DV is attributed to IV? Effect size for ANOVA: eta-squared (η ) SS SS Between Total
Post-hoc tests If ANOVA result is significant How do you know which grps differ? Need to do t-tests but reduce Type I error Use Tukey s HSD test Pairwise comparisons while keeping same alpha level