Comparing Group Means: The T-test and One-way ANOVA Using STATA, SAS, and SPSS
Comparing Several Means: One-way ANOVA
description
Transcript of Comparing Several Means: One-way ANOVA
![Page 1: Comparing Several Means: One-way ANOVA](https://reader035.fdocuments.net/reader035/viewer/2022062411/56816836550346895dddf488/html5/thumbnails/1.jpg)
Comparing Several Means:
One-way ANOVALesson 15
![Page 2: Comparing Several Means: One-way ANOVA](https://reader035.fdocuments.net/reader035/viewer/2022062411/56816836550346895dddf488/html5/thumbnails/2.jpg)
Analysis of Variance
or ANOVA Comparing 2 or more treatments
i.e., groups Simultaneously
H0: 1 = 2 = 3 … H1: at least one population different
from others ~
![Page 3: Comparing Several Means: One-way ANOVA](https://reader035.fdocuments.net/reader035/viewer/2022062411/56816836550346895dddf488/html5/thumbnails/3.jpg)
Experimentwise Error
Why can’t we just use t tests? Type 1 error: incorrectly rejecting H0 each comparison = .05
Experimentwise probability of type 1 error P (1 or more Type 1 errors) ~
![Page 4: Comparing Several Means: One-way ANOVA](https://reader035.fdocuments.net/reader035/viewer/2022062411/56816836550346895dddf488/html5/thumbnails/4.jpg)
Experimentwise Error
H0: 1 = 2 = 3
Approximate experimentwise errorH0: 1 = 2 = .05H0: 1 = 3 = .05H0: 2 = 3 = .05
experimentwise .15 ANOVA: only one H0
= .05 (or level you select) ~
![Page 5: Comparing Several Means: One-way ANOVA](https://reader035.fdocuments.net/reader035/viewer/2022062411/56816836550346895dddf488/html5/thumbnails/5.jpg)
Analysis of Variance: Terminology Factor
independent variable Single-Factor Design (One-way)
single independent variable with 2 or more levels
levels: values of independent variable ~
![Page 6: Comparing Several Means: One-way ANOVA](https://reader035.fdocuments.net/reader035/viewer/2022062411/56816836550346895dddf488/html5/thumbnails/6.jpg)
Analysis of Variance: Terminology Repeated Measures ANOVA
Same logic as paired t test Factorial Design
More than one independent variable Life is complex: interactions
Mixed Factorial Design At least 1 between-groups & within
groups variable Focus on independent-measures ~
![Page 7: Comparing Several Means: One-way ANOVA](https://reader035.fdocuments.net/reader035/viewer/2022062411/56816836550346895dddf488/html5/thumbnails/7.jpg)
e.g., Effects of caffeine on reaction timeSingle-factor design
with 3 levels
Caffeine dose
0 mg 50 mg 100 mg
1 rt M 2 rt M 3 rt M
3 x 2 Factorial design
Sexmale
female
0 mg 50 mg 100 mg
1 rt M 2 rt M 3 rt M
4 rt M 5 rt M 6 rt M
![Page 8: Comparing Several Means: One-way ANOVA](https://reader035.fdocuments.net/reader035/viewer/2022062411/56816836550346895dddf488/html5/thumbnails/8.jpg)
Test Statistic F ratio
ratio of 2 variances
(error) chanceby expected difference
means samplebetween differencet
(error) chance by expected e)(differenc variancemeans sample between es)(differenc variance
F
same concept as t tests
F = t2 Only 2 groups ~
![Page 9: Comparing Several Means: One-way ANOVA](https://reader035.fdocuments.net/reader035/viewer/2022062411/56816836550346895dddf488/html5/thumbnails/9.jpg)
F ratio MS: mean squared deviations = variance MSB = MS between treatments
Textbook: MSM
Average distance b/n sample means MSW = MS within treatments
Textbook: MSR differences between individuals same as s2
pooled ~
![Page 10: Comparing Several Means: One-way ANOVA](https://reader035.fdocuments.net/reader035/viewer/2022062411/56816836550346895dddf488/html5/thumbnails/10.jpg)
Logic of ANOVA
Differences b/n groups (means) bigger than difference between individuals?
If H0 false then distance between groups should
be larger ~
W
B
MSMSF
![Page 11: Comparing Several Means: One-way ANOVA](https://reader035.fdocuments.net/reader035/viewer/2022062411/56816836550346895dddf488/html5/thumbnails/11.jpg)
Partitioning SS SST = total sums of squares
total variability SSB = between-treatments sums of squares
variability between groups SSW = within-treatments sums of squares
variability between individuals
WBT SSSSSS T
B
SSSSR 2
* % variance explained by IV
![Page 12: Comparing Several Means: One-way ANOVA](https://reader035.fdocuments.net/reader035/viewer/2022062411/56816836550346895dddf488/html5/thumbnails/12.jpg)
Calculating SS
TSS 2)( Grandi XX
BSS
WSS 2)( ki XX
2)( Grandk XX
![Page 13: Comparing Several Means: One-way ANOVA](https://reader035.fdocuments.net/reader035/viewer/2022062411/56816836550346895dddf488/html5/thumbnails/13.jpg)
Calculating MS
dfSSMS
![Page 14: Comparing Several Means: One-way ANOVA](https://reader035.fdocuments.net/reader035/viewer/2022062411/56816836550346895dddf488/html5/thumbnails/14.jpg)
Calculating MSW Same as s2
pooled for > 2 samples
WW df
SSSSSSMS 321 kNdfW
![Page 15: Comparing Several Means: One-way ANOVA](https://reader035.fdocuments.net/reader035/viewer/2022062411/56816836550346895dddf488/html5/thumbnails/15.jpg)
Calculating MSB
B
BB df
SSMS 1kdfB
![Page 16: Comparing Several Means: One-way ANOVA](https://reader035.fdocuments.net/reader035/viewer/2022062411/56816836550346895dddf488/html5/thumbnails/16.jpg)
SPSS One-way ANOVA Menu
Analyze Compare Means One-way ANOVA
Dialog box Dependent List (DV) Factor (IV) Options:
Descriptives, Homogeneity of Variance Post Hoc ~
![Page 17: Comparing Several Means: One-way ANOVA](https://reader035.fdocuments.net/reader035/viewer/2022062411/56816836550346895dddf488/html5/thumbnails/17.jpg)
Interpreting ANOVA Reject H0
at least one sample different from others do not know which one(s)
Must use post hoc tests Post hoc: after the fact ONLY if rejected H0 for ANOVA
Many post hoc tests Differ on how conservative ~
![Page 18: Comparing Several Means: One-way ANOVA](https://reader035.fdocuments.net/reader035/viewer/2022062411/56816836550346895dddf488/html5/thumbnails/18.jpg)
Post Hoc Test: Pairwise comparisons Adjusted levels LSD (Least Significant Difference)
Basically t-test, no adjustment Tukey’s HSD
Similar logic to t – test Scheffe Test
F test with only 2 groups Differ on how conservative
More conservative bigger difference required ~
![Page 19: Comparing Several Means: One-way ANOVA](https://reader035.fdocuments.net/reader035/viewer/2022062411/56816836550346895dddf488/html5/thumbnails/19.jpg)
Detour Learning Task
Prenatal exposure to methamphetamine effects on learning?
FIGURE 1Males
0
50
100
150
200
250
300
350
1 2 3 4
Detour Learning Trial
Mea
n La
tenc
y to
Soc
ial C
onta
ct Strangers
Cagemates