Transcript 11/19/2015

Psychology 202a
Advanced Psychological
Statistics
November 19, 2015
The Plan for Today
•
•
•
•
•
Visualizing ANOVA (continued)
ANOVA as a special case of regression
Post hoc comparisons
Contrasts
Orthogonal contrasts and contrast coding
Visualizing ANOVA
•
•
•
•
Parallel boxplots
Bar plots of means
Line graphs of means
Rules for choice of bar plots or line graphs
– Grouping variable’s level of measurement
technically should be interval or ratio for line
graph
– Often violated (without particularly dire
consequences)
Reviewing ANOVA in SAS
the easy way
• The “class” statement.
• “class” tells SAS “Figure out how to code
this classification variable so that we can
handle it using regression.”
• Let’s see how such coding works.
• Examples in SAS
An outlier test
• Sometimes we can use creative coding to
do clever things in regression.
• Recall that our regression of Peabody on
Raven had one observation that disturbed
us.
• Create a dummy code for that observation.
(Example in SAS.)
• Also known as the “externally Studentized
residual”
Results of dummy coding
Group
D1
D2
Massed Practice
1
0
Spaced Practice
0
1
No Practice
0
0
Other forms of coding
• Any coding system that uses two variables
to identify the three groups will produce
the same ANOVA
• This idea will turn out to be profoundly
useful
• Example: effects coding
Example of effects coding
Group
D1
D2
Massed Practice
1
0
Spaced Practice
0
1
No Practice
-1
-1
Asking more detailed questions
• So far, we haven’t really learned anything
interesting about these means.
• Post hoc procedures
– Illustration in SAS
Asking more detailed questions
• When possible, if we can plan our
questions in advance, we will be more
likely to find effects.
A priori contrasts
• A contrast is a question about a linear
combination of means.
• Example:
H0 :
Massed  Spaced
2
 None  0
• Shorthand notation: 1/2 1/2 -1
• Equivalent: 1 1 -2
• Another question that might interest us is 1 -1 0.
Contrasts (continued)
• Once a contrast is specified, its sum of squares is
calculated:
k
SS contrast


 c i M i 
  i 1k 2 
2
c
i

n
i
1
i
• Contrasts always have 1 df, so the sum of
squares is a mean square.
• Division by the error mean square provides an F
statistic that tests the contrast.