Upload
nissim-gallagher
View
30
Download
0
Embed Size (px)
DESCRIPTION
Experimental Statistics Spring 2006 - week 6. Chapter 15: Factorial Models (15.5). STIMULUS EXAMPLE: Personal computer presents stimulus, and person responds. Study of how RESPONSE TIME is effected by a WARNING given prior to the stimulus: 2-factors of interest: - PowerPoint PPT Presentation
Citation preview
1
Experimental StatisticsExperimental Statistics Spring 2006 Spring 2006
- week 6 - week 6
Experimental StatisticsExperimental Statistics Spring 2006 Spring 2006
- week 6 - week 6
Chapter 15: Factorial Models (15.5)
2
STIMULUS EXAMPLE:
Personal computer presents stimulus, and person responds.
Study of how RESPONSE TIME is effected by a WARNING given prior to the stimulus:
2-factors of interest:
Warning Type --- auditory or visual
Time between warning and stimulus -- 5 sec, 10 sec, or 15 sec.
3
.204 .257
.170 .279
.190 .269
.167 .282
.182 .255
.187 .274
.192 .256
.200 .281
.216 .258
Auditory Visual
5 sec
10 sec
15 sec
WarningTime
Note: “Sort of like RCB” -- what is the difference?
Question: How would you randomize? - 18 subjects - 1 subject
4
Observed data
ijky
Level of Factor A
Level of Factor B
Replication
(warning type) (time)
(response time)
Stimulus Data
5
FactorA
Factor B
2-Factor ANOVA Data
6
.
..
. .
...
ij
i
j
y
y
y
y
7
A Possible Model for STIMULUS Data
ij i j
ijk i j ijky
Note:
so according to this model
1 2 difference between types 1 and 2 at time
j j j
Note: The model assumes that the difference between types is the same for all times
i = type, j = time
8
Auditory
Visual
5 10 15
Hypothetical Cell MeansHypothetical Cell Means
9
ij ij j j
Similarly
i.e. the model says the difference between times j and j' is the same for all types
We may not want to make these assumptions!!
10
Auditory
Visual
5 10 15
Hypothetical Cell MeansHypothetical Cell Means
Auditory
Visual
5 10 15
11
Model for 2-factor Design
ijk i j ij ijky
1 1 1 1
0a b a b
i j ij iji j i j
where
12
2 2... .. ...
1 1 1 1
2. . ...
1
2. .. . . ...
1 1
2...
1
( ) ( )
( )
( )
( )
a b n a
ijk ii j k i
b
jj
a b
ij i ji j
ijkk
y y bn y y
an y y
n y y y y
y y
1 1
a b n
i j
Sum-of-Squares Breakdown
(2-factor ANOVA)
SSA
SSB
SSAB
SSE
13
2-Factor ANOVA Table(2-Factor Completely Randomized Design)
Source SS df MS F
Main Effects
A SSA a 1
B SSB b1
Interaction
AB SSAB (a 1)(b1)
Error SSE ab(n 1) Total TSS abn
/( 1)MSB SSB b
/ ( 1)MSE SSE ab n
/MSA MSE
See page 900
/( 1)( 1)MSAB SSAB a b
/MSB MSE
/( 1)MSA SSA a
/MSAB MSE
14
0
( 1, ( 1))
H
MSBF F b ab n
MSE
Reject at level if
0 1 2: 0
: 0
a
a i
H
H
at least one
Hypotheses:
Main Effects:
0 1 2: 0
: 0
b
a j
H
H
at least one
0
( 1, ( 1))
H
MSAF F a ab n
MSE
Reject at level if
0
(( 1)( 1), ( 1))
H
MSABF F a b ab n
MSE
Reject at level if
Interactions:
0 11 12: 0
: 0
ab
a ij
H
H
at least one
15
data stimulus;input type$ time response;datalines;A 5 .204A 5 .170A 5 .190A 10 .167A 10 .182A 10 .187A 15 .192A 15 .200A 15 .216V 5 .257V 5 .279V 5 .269V 10 .282V 10 .255V 10 .274V 15 .256V 15 .281V 15 .258;PROC GLM; CLASSES type time; MODEL response=type time type*time; means type/lsd; means time/lsd; TITLE ‘Stimulus Data';run;
Stimulus Data -- SAS
16
The GLM Procedure
Dependent Variable: response
Sum of
Source DF Squares Mean Square F Value Pr > F
Model 5 0.02837783 0.00567557 32.24 <.0001
Error 12 0.00211267 0.00017606
Corrected Total 17 0.03049050
R-Square Coeff Var Root MSE response Mean
0.930711 5.798365 0.013269 0.228833
Source DF Type I SS Mean Square F Value Pr > F
type 1 0.02745606 0.02745606 155.95 <.0001
time 2 0.00026533 0.00013267 0.75 0.4917
type*time 2 0.00065644 0.00032822 1.86 0.1972
GLM Output
17
Testing ProcedureTesting Procedure2 factor CRD Design
Step 1. Test for interaction.
Step 2.(a) IF there IS NOT a significant interaction - test the main effects
(b) IF there IS a significant interaction - compare cell means
18
Stimulus Example
1.86MSAB
FMSE
Test for Interaction:
.1972P
Therefore we DO NOT reject the null hypothesis of no interaction.
19
Stimulus Data
t ype A V
r esponse
0. 17
0. 18
0. 19
0. 20
0. 21
0. 22
0. 23
0. 24
0. 25
0. 26
0. 27
0. 28
t i me
5 6 7 8 9 10 11 12 13 14 15
t i me 5 10 15
r esponse
0. 17
0. 18
0. 19
0. 20
0. 21
0. 22
0. 23
0. 24
0. 25
0. 26
0. 27
0. 28
t ype
A V
B
B
20
Stimulus Example
1.86MSAB
FMSE
Test for Interaction:
.1972P
Therefore we DO NOT reject the null hypothesis of no interaction.
Thus - based on the testing procedure, we next test for main effects.
1 2 22
( )α/MSE
y y tN
| |
Testing Main Effects:Testing Main Effects:
For each main effect (i.e. A and B)
0H- test
0H- if is rejected, compare marginal means
using an appropriate procedure (eg. LSD or BON)
Note: I’ll use LSD from this point on unless otherwise noted.
1 2(y y2 marginal means and ) are declared
to be significantly different (using LSD) ifIn General:
where N denotes the # of observations involved in the computation of a marginal mean.
22
Auditory Visual
5 sec
10 sec
15 sec
WarningTime
1.. .190y 2.. .268y
.1. .228y
.2. .225y
.3. .234y
.204 .257
.170 .279
.190 .269
.167 .282
.182 .255
.187 .274
.192 .256
.200 .281
.216 .258
23
Stimulus Example
155.95MSA
FMSE
Test for Main Effects:
Thus, there is a significant effect due to type but not time
A (type): .0001P
B (time): 0.75MSB
FMSE
.4917P
- i.e. we can use LSD to compare marginal means for type
- we will do this here for illustration although MC not needed when there are only 2 groups
24
The GLM Procedure
t Tests (LSD) for response
NOTE: This test controls the Type I comparisonwise error rate, not
the experimentwise error rate.
Alpha 0.05
Error Degrees of Freedom 12
Error Mean Square 0.000176
Critical Value of t 2.17881
Least Significant Difference 0.0136
Means with the same letter are not significantly different.
t Grouping Mean N type
A 0.267889 9 V
B 0.189778 9 A
GLM Output -- Comparing “Types”
25
The GLM Procedure t Tests (LSD) for response
NOTE: This test controls the Type I comparisonwise error rate, not the experimentwise error rate.
Alpha 0.05 Error Degrees of Freedom 12 Error Mean Square 0.000176 Critical Value of t 2.17881 Least Significant Difference 0.0167
Means with the same letter are not significantly different.
t Grouping Mean N time A 0.233833 6 15 A A 0.228167 6 5 A A 0.224500 6 10
GLM Output -- Comparing “Times”
26
A5 A10 A15 V5 V10 V15
0. 150
0. 175
0. 200
0. 225
0. 250
0. 275
0. 300
response
cel l i d
27
- 0. 016 - 0. 008 0 0. 008 0. 016
0
5
10
15
20
25
30
Percent
r es i d
28
Pilot Plant Data Variable = Chemical Yield Factors: A – Temperature (160, 180)
B – Catalyst (C1 , C2) 160 C1 59160 C1 61160 C1 50 160 C1 58180 C1 74180 C1 70180 C1 69180 C1 67160 C2 50160 C2 54160 C2 46160 C2 44180 C2 81180 C2 85180 C2 79180 C2 81
29
Pilot Plant Data
Variable = Chemical Yield
Factors: A – Temperature (160, 180) B – Catalyst (C1 , C2)
59 74 61 70 50 69 58 67
50 81 54 85 46 79 44 81
o o160 180
C1
C2
Catalyst
Temperature
30
31
- 6 - 3 0 3 6
0
5
10
15
20
25
30
35
40
Percent
r es i d
32
Pilot Plant -- Probability Plot of Residuals
33
DATA one;INPUT temp catalyst$ yield;datalines;160 C1 59160 C1 61 . . .180 C2 79180 C2 81;PROC GLM; class temp catalyst; MODEL yield=temp catalyst temp*catalyst; Title 'Pilot Plant Example -- 2-way ANOVA'; MEANS temp catalyst/LSD; RUN;PROC SORT;BY temp catalyst;PROC MEANS; BY temp catalyst; OUTPUT OUT=cells MEAN=yield;RUN;
34
Pilot Plant Example -- 2-way ANOVA General Linear Models Procedure Dependent Variable: YIELD Sum of MeanSource DF Squares Square F Value Pr > F Model 3 2525.0000000 841.6666667 58.05 0.0001 Error 12 174.0000000 14.5000000 Corrected Total 15 2699.0000000 R-Square C.V. Root MSE YIELD Mean 0.935532 5.926672 3.8078866 64.250000 Source DF Type I SS Mean Square F Value Pr > F TEMP 1 2116.0000000 2116.0000000 145.93 0.0001CATALYST 1 9.0000000 9.0000000 0.62 0.4461TEMP*CATALYST 1 400.0000000 400.0000000 27.59 0.0002
Pilot Plant -- GLM Output
35
RECALL: RECALL: Testing ProcedureTesting Procedure 2 factor CRD Design
Step 1. Test for interaction.
Step 2.(a) IF there IS NOT a significant interaction - test the main effects
(b) IF there IS a significant interaction - compare cell means
36
Pilot Plant Example
27.59MSAB
FMSE
Test for Interaction:
.0002P
Therefore we reject the null hypothesis of no interaction - and conclude that there is an interaction between temperature and catalyst.
Thus, we DO NOT test main effects
37
38
39
Since there is a significant interaction, we do not test for main effects!
- instead compare “Cell Means”
- NOTE: interaction plot is a plot of the cell means
40
Pilot Plant Data
Variable = Chemical Yield
Factors: A – Temperature (160, 180) B – Catalyst (C1 , C2)
59 74 61 70 50 69 58 67
50 81 54 85 46 79 44 81
o o160 180
C1
C2
Catalyst
Temperature
41
Pilot Plant Data -- cell means
57.0 70.0 48.5 81.5
o o160 180
C1
C2
Catalyst
Temperature
1 2 22
( )α/MSE
y y tN
| |
Comparing Cell Means:Comparing Cell Means:
If there is significant interaction, then we compare the a x b cell means using the criteria below.
1 2(y y2 cell means and ) are declared
to be significantly different (using LSD) if
Procedure similar to that for comparing marginal means:
where N denotes the # of observations involved in the computation of a cell mean.
43
The GLM Procedure
t Tests (LSD) for yield NOTE: This test controls the Type I comparisonwise error rate, not the experimentwise error rate. Alpha 0.05 Error Degrees of Freedom 12 Error Mean Square 14.5 Critical Value of t 2.17881 Least Significant Difference 4.1483 Means with the same letter are not significantly different. t Grouping Mean N temp A 75.750 8 180 B 52.750 8 160
GLM Output -- Comparing “Temps”
- disregard
44
The GLM Procedure t Tests (LSD) for yield
NOTE: This test controls the Type I comparisonwise error rate, not the experimentwise error rate. Alpha 0.05 Error Degrees of Freedom 12 Error Mean Square 14.5 Critical Value of t 2.17881 Least Significant Difference 4.1483 Means with the same letter are not significantly different. t Grouping Mean N catalyst A 65.000 8 C2 A A 63.500 8 C1
GLM Output -- Comparing “Catalysts”
- disregard
45
Note:
- SAS does not provide a comparison of cell means
46
Pilot Plant Data -- cell means
57.0 70.0 48.5 81.5
o o160 180
C1
C2
Catalyst
Temperature
1 2 22
( )α/MSE
y y tN
| | LSD:
.025 2.1788t
MSE =
N =
LSD =
C2/160 C1/160 C1/180 C2/180 48.5 57.0 70.0 81.5
47
Testing Procedure RevistedTesting Procedure Revisted2 factor CRD Design
Step 1. Test for interaction.
Step 2.(a) IF there IS NOT a significant interaction - test the main effects
(b) IF there IS a significant interaction - compare a x b cell means (by hand)
Main Idea:
We are trying to determine whether the factors effect the response either individually or collectively.