1 Experimental Statistics Spring 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.
Auditory Visual 5 sec 10 sec 15 sec Warning Time Note: “Sort of like RCB” -- what is the difference? Question: How would you randomize? - 18 subjects - 1 subject
4 Observed data Level of Factor A Level of Factor B Replication (warning type) (time) (response time) Stimulus Data
5 Factor A Factor B 2-Factor ANOVA Data
6
7 A Possible Model for STIMULUS Data Note: so according to this model Note: The model assumes that the difference between types is the same for all times i = type, j = time
8 Auditory Visual Hypothetical Cell Means
9 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 Hypothetical Cell Means Auditory Visual
11 Model for 2-factor Design where
12 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 b 1 Interaction AB SSAB ( a 1)(b 1) Error SSE ab(n 1) Total TSS abn See page 900
14 Hypotheses: Main Effects: Interactions:
15 data stimulus; input type$ time response; datalines; A A A A A A A A A V V V V V V V V V ; 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 <.0001 Error Corrected Total R-Square Coeff Var Root MSE response Mean Source DF Type I SS Mean Square F Value Pr > F type <.0001 time type*time GLM Output
17 Testing 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
18 Stimulus Example Test for Interaction: Therefore we DO NOT reject the null hypothesis of no interaction.
19 Stimulus Data
20 Stimulus Example Test for Interaction: Therefore we DO NOT reject the null hypothesis of no interaction. Thus - based on the testing procedure, we next test for main effects.
Testing Main Effects: For each main effect (i.e. A and B) Note: I’ll use LSD from this point on unless otherwise noted. In General: where N denotes the # of observations involved in the computation of a marginal mean.
22 Auditory Visual 5 sec 10 sec 15 sec Warning Time
23 Stimulus Example Test for Main Effects: Thus, there is a significant effect due to type but not time A (type): B (time): - 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 Critical Value of t Least Significant Difference Means with the same letter are not significantly different. t Grouping Mean N type A V B 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 Critical Value of t Least Significant Difference Means with the same letter are not significantly different. t Grouping Mean N time A A A A A GLM Output -- Comparing “Times”
26
27
28 Pilot Plant Data Variable = Chemical Yield Factors:A – Temperature (160, 180) B – Catalyst (C1, C2) 160 C C C C C C C C C C C C C C C C2 81
29 Pilot Plant Data Variable = Chemical Yield Factors:A – Temperature (160, 180) B – Catalyst (C1, C2) Catalyst Temperature
30
31
32 Pilot Plant -- Probability Plot of Residuals
33 DATA one; INPUT temp catalyst$ yield; datalines; 160 C C C 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 Mean Source DF Squares Square F Value Pr > F Model Error Corrected Total R-Square C.V. Root MSE YIELD Mean Source DF Type I SS Mean Square F Value Pr > F TEMP CATALYST TEMP*CATALYST Pilot Plant -- GLM Output
35 RECALL: Testing 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 Test for Interaction: 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) Catalyst Temperature
41 Pilot Plant Data -- cell means Catalyst Temperature
Comparing Cell Means: If there is significant interaction, then we compare the a x b cell means using the criteria below. 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 Least Significant Difference Means with the same letter are not significantly different. t Grouping Mean N temp A B 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 Least Significant Difference Means with the same letter are not significantly different. t Grouping Mean N catalyst A C2 A A C1 GLM Output -- Comparing “Catalysts” - disregard
45 Note: - SAS does not provide a comparison of cell means
46 Pilot Plant Data -- cell means CatalystCatalyst Temperature LSD: MSE = N = LSD = C2/160 C1/160 C1/180 C2/
47 Testing Procedure Revisted 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 a x b cell means (by hand) Main Idea: We are trying to determine whether the factors effect the response either individually or collectively.