statistics for the social sciences psychology 340 spring 2005 within groups anova
Post on 21-Dec-2015
214 Views
Preview:
TRANSCRIPT
Statistics for the Social Sciences
Psychology 340Spring 2005
Within Groups ANOVA
Statistics for the Social Sciences
Outline
• Basics of within groups ANOVA– Repeated measures– Matched samples
• Computations• Within groups ANOVA in SPSS
Statistics for the Social Sciences
Example
• Suppose that you want to compare three brand name pain relievers. – Give each person a drug, wait 15 minutes, then ask them to keep their hand in a bucket of cold water as long as they can. The next day, repeat (with a different drug)• Dependent variable: time in ice water• Independent variable: 4 levels, within groups
– Placebo– Drug A– Drug B– Drug C
Statistics for the Social Sciences
Statistical analysis follows design
• The 1 factor within groups ANOVA:
– One group
– Repeated measures– More than 2 scores per subject
Statistics for the Social Sciences
Statistical analysis follows design
• The 1 factor within groups ANOVA:
– One group
– Repeated measures– More than 2 scores per subject
– More than 2 groups
– Matched samples– Matched groups
- OR -
Statistics for the Social Sciences
Within-subjects ANOVA
Placebo Drug A Drug B Drug C
3 4 6 7
0 3 3 6
2 1 4 5
0 1 3 4
0 1 4 3
XA =2.0
SSA =8.0
XB =4.0
SSB =6.0
XC =5.0
SSC =10.0
XP =1.0
SSP =8.0
XBXA XCXP
• n = 5 participants• Each participates in every condition (4 of these)
Statistics for the Social Sciences
Within-subjects ANOVA
– Step 2: Set your decision criteria– Step 3: Collect your data – Step 4: Compute your test statistics
• Compute your estimated variances (2 steps of partitioning used)
• Compute your F-ratio• Compute your degrees of freedom (there are even more now)
– Step 5: Make a decision about your null hypothesis
• Hypothesis testing: a five step program
– Step 1: State your hypotheses
Statistics for the Social Sciences
Step 4: Computing the F-ratio
• Analyzing the sources of variance– Describe the total variance in the dependent measure
• Why are these scores different? • Sources of
variability– Between groups– Within groups
XBXA XCXP
• Individual differences• Left over variance (error)
Because we use the same people in each
condition, we can figure out how much of the
variability comes from the individuals and remove it from the
analysis
Because we use the same people in each
condition, we can figure out how much of the
variability comes from the individuals and remove it from the
analysis
Statistics for the Social Sciences
Partitioning the variance
Total variance
Stage 1
Between groups variance Within groups variance
Statistics for the Social Sciences
Partitioning the variance
Total variance
Stage 1
Between groups variance Within groups variance
Stage 2Between subjects varianceError variance
Statistics for the Social Sciences
Partitioning the variance
Total variance
Stage 1
Between groups variance Within groups variance
Stage 2Between subjects varianceError variance
1) Treatment effect
2) Error or chance (without individual differences)
1) Individual differences
2) Other error
1) Other error (without individual differences)
1) Individual differences
Because we use the same people in each
condition, none of this variability comes from having different people in different conditions
Because we use the same people in each
condition, none of this variability comes from having different people in different conditions
Statistics for the Social Sciences
• The F ratio– Ratio of the between-groups variance estimate to the population error variance estimate
Step 4: Computing the F-ratio
Observed variance
Variance from chanceF-ratio = =
MSBetweenMSError
Statistics for the Social Sciences
Partitioning the variance
Total variance
Stage 1
Between groups variance Within groups variance
Stage 2Between subjects varianceError variance
1) Treatment effect
2) Error or chance (without individual differences)
1) Individual differences
2) Other error
1) Other error (without individual differences)
1) Individual differences
F =MSBetweenMSError
Statistics for the Social Sciences
Partitioning the variance
Total variance
Stage 1
Between groups variance Within groups variance
SSTotal = X−GM( )∑ 2
dfTotal =N−1
SSWithin = SSeach group∑dfWithin = dfeach group∑
SSBetween = n X−GM( )∑ 2
dfbetween =#groups−1
Statistics for the Social Sciences
Partitioning the variance
Placebo Drug A Drug B Drug C
3 4 6 7
0 3 3 6
2 1 4 5
0 1 3 4
0 1 4 3
XA =2.0SSA =8.0
XB =4.0SSB =6.0
XC =5.0SSC =10.0
XP =1.0SSP =8.0
GM =3.0
SSTotal = X−GM( )∑ 2= 3−3( )2 + ...+ 3−3( )2
dfTotal =N−1=20 −1=19SSTotal =82
SSBetween = n X−GM( )∑ 2
dfbetween =#groups−1=4 −1=3
=5 1 − 3( )2
+ 5 2 − 3( )2
+ 5 4 − 3( )2
+ 5 5 − 3( )2
=50.0
SSWithin = SSeach group∑ =SSP +SSA +SSB +SSC =32
dfWithin = dfeach group∑ =4 + 4 + 4 + 4 =16
Statistics for the Social Sciences
Partitioning the variance
Total variance
Stage 1
Between groups variance Within groups variance
Stage 2Between subjects varianceError variance
SSTotal = X−GM( )∑ 2
dfTotal =N−1
SSWithin = SSeach group∑dfWithin = dfeach group∑
SSBetween = n X−GM( )∑ 2
dfbetween =#groups−1
Statistics for the Social Sciences
PWhat is ?
Partitioning the variance
Placebo Drug A Drug B Drug C
3 4 6 7
0 3 3 6
2 1 4 5
0 1 3 4
0 1 4 3
XA =2.0
SSA =8.0
XB =4.0
SSB =6.0
XC =5.0
SSC =10.0
XP =1.0
SSP =8.0
The average score for each person
GM =3.0
Between subjects variance
SSBetweenSubs = ngroups P −GM( )∑ 2
Statistics for the Social Sciences
Partitioning the variance
Placebo Drug A Drug B Drug C
3 4 6 7
0 3 3 6
2 1 4 5
0 1 3 4
0 1 4 3
XA =2.0
SSA =8.0
XB =4.0
SSB =6.0
XC =5.0
SSC =10.0
XP =1.0
SSP =8.0SSBetweenSubs = ngroups P −GM( )∑ 2
dfbetweenSubs =nsubjects −1=5−1=4
PWhat is ?The average score for each person
P20
4 =5.012
4 =3.012
4 =3.08
4 =2.08
4 =2.0
GM =3.0
=4 5 − 3( )2
+ 4 3 − 3( )2
+ 4 3 − 3( )2
+
4 2 −3( )2 + 4 2 −3( )2
=24
Between subjects variance
Statistics for the Social Sciences
Partitioning the variance
Total variance
Stage 1
Between groups variance Within groups variance
Stage 2Between subjects varianceError variance
SSTotal = X−GM( )∑ 2
dfTotal =N−1
SSWithin = SSeach group∑dfWithin = dfeach group∑
SSBetween = n X−GM( )∑ 2
dfbetween =#groups−1
dfbetweenSubs =nsubjects −1
SSBetweenSubs = ngroups P −GM( )∑ 2
Statistics for the Social Sciences
Partitioning the variance
Placebo Drug A Drug B Drug C
3 4 6 7
0 3 3 6
2 1 4 5
0 1 3 4
0 1 4 3
XA =2.0
SSA =8.0
XB =4.0
SSB =6.0
XC =5.0
SSC =10.0
XP =1.0
SSP =8.0SSError =SSWithin −SSBetweenSubsGM =3.0
Error variance
SSError =32 −24 =8
dferror = Nscores −ngroups( )− nsubjects −1( )
dferror = 20 −4( )− 5 −1( ) =12
Statistics for the Social Sciences
Partitioning the variance
Total variance
Stage 1
Between groups variance Within groups variance
Stage 2Between subjects varianceError variance
SSTotal = X−GM( )∑ 2
dfTotal =N−1
SSWithin = SSeach group∑dfWithin = dfeach group∑
SSBetween = n X−GM( )∑ 2
dfbetween =#groups−1
SSError =SSWithin −SSBetweenSubs
dfbetweenSubs =nsubjects −1
SSBetweenSubs = ngroups P −GM( )∑ 2
dferror = Nscores −ngroups( )− nsubjects −1( )
Statistics for the Social Sciences
Partitioning the variance
Mean Squares (Variance)
SSBetween =50.0
dfbetween =3
MSBetween =50.03
=16.67 MSError =812
=0.67
Between groups variance
Error variance
SSError =8
dferror =12
Now we return to variance. But, we call it Means Square (MS)
Now we return to variance. But, we call it Means Square (MS)
Recall:Recall:
variance =SSdf
Statistics for the Social Sciences
Partitioning the variance
Total variance
Stage 1
Between groups variance Within groups variance
Stage 2Between subjects varianceError variance
dfTotal =19SSTotal =82
SSWithin =32dfWithin =16
SSBetween =50dfbetween =3
SSError =8dferror =12
SSBetweenSubs =24
dfbetweenSubs =4
MSBetween =6.0
MSError =0.67
Statistics for the Social Sciences
Within-subjects ANOVA
• The F table– Need two df’s
• dfbetween (numerator)
• dferror (denominator)
– Values in the table correspond to critical F’s• Reject the H0 if your computed value is greater than or equal to the critical F
– Separate tables for 0.05 & 0.01
Do we reject or failto reject the H0?Do we reject or failto reject the H0?
– From the table (assuming 0.05) with 3 and 12 degrees of freedom the critical F = 3.89.
– So we reject H0 and conclude that not all groups are the same
F =MSBetweenMSError
=16.67
0.67= 24.89
Statistics for the Social Sciences
Within-subjects ANOVA in SPSS
– Setting up the file– Running the analysis– Looking at the output
top related