Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Experimental Statistics - week 6 Chapter 15: Randomized Complete Block Design (15.3) Factorial Models (15.5)

Similar presentations


Presentation on theme: "1 Experimental Statistics - week 6 Chapter 15: Randomized Complete Block Design (15.3) Factorial Models (15.5)"— Presentation transcript:

1 1 Experimental Statistics - week 6 Chapter 15: Randomized Complete Block Design (15.3) Factorial Models (15.5)

2 2 Caution: Chapter 15 introduces some new notation - i.e. changes notation already defined

3 3 Recall: Sum-of-Squares Identity 1-Factor ANOVA In words: T otal SS = SS between samples + within sample SS

4 4 Recall: Sum-of-Squares Identity 1-Factor ANOVA - new notation for Chapter 15

5 5 Recall: Sum-of-Squares Identity 1-Factor ANOVA - new notation for Chapter 15

6 6 Recall: Sum-of-Squares Identity 1-Factor ANOVA - new notation for Chapter 15 In words: T otal SS = SS for “treatments” + SS for “error”

7 7 Revised ANOVA Table for 1-Factor ANOVA (Ch. 15 terminology - p.857) Source SS df MS F Treatments SST t  1 Error SSE N  t Total TSS N 

8 8 Recall CRD Model for Gasoline Data y ij =  i  ij y ij =  i  ij or unexplained part mean for i th gasoline observed octane -- car-to-car differences -- temperature -- etc.

9 9 Gasoline Data Question: What if car differences are obscuring gasoline differences? Similar to diet t-test example: Recall: person-to-person differences obscured effect of diet

10 10 Possible Alternative Design: Test all 5 gasolines on the same car - in essence we test the gasoline effect directly and remove effect of car-to-car variation Question: How would you randomize an experiment with 4 cars?

11 11 Blocking an Experiment - dividing the observations into groups (called blocks) where the observations in each block are collected under relatively similar conditions - comparisons can many times be made more precisely this way

12 12 Terminology is based on Agricultural Experiments Consider the problem of testing fertilizers on a crop - t fertilizers - n observations on each

13 13 Completely Randomized Design A A B B C C B A C C B A A B C t = 3 fertilizers n = 5 replications - randomly select 15 plots - randomly assign fertilizers to the 15 plots

14 14 Randomized Complete Block Strategy B | A | C A | C | B C | A | B A | B | C C | B | A t = 3 fertilizers - select 5 “blocks” - randomly assign the 3 treatments to each block Note: The 3 “plots” within each block are similar - similar soil type, sun, water, etc

15 15 Randomized Complete Block Design Randomly assign each treatment once to every block Car Example Car 1: randomly assign each gas to this car Car 2:.... etc. Agricultural Example Randomly assign each fertilizer to one of the 3 plots within each block

16 16 y ij =  i  j  ij Model For Randomized Complete Block (RCB) Design effect of i th treatment effect of j th block unexplained error (car)(gasoline) -- temperature -- etc.

17 17

18 18 Back to CAR data: Suppose that instead of 20 cars, there were only 4 cars, and we tested each gasoline on each car. “Restructured” CAR Data A 91.7 91.2 90.9 90.6 B 91.7 91.9 90.9 90.9 C 92.4 91.2 91.6 91.0 D 91.8 92.2 92.0 91.4 E 93.1 92.9 92.4 92.4 Old Data Format 1 2 3 4 Car Gas A 91.7 91.2 90.9 90.6 B 91.7 91.9 90.9 90.9 C 92.4 91.2 91.6 91.0 D 91.8 92.2 92.0 91.4 E 93.1 92.9 92.4 92.4 Gas

19 19 Back to CAR data: Suppose that instead of 20 cars, there were only 4 cars, and we tested each gasoline on each car. “Restructured” CAR Data A 91.7 91.2 90.9 90.6 B 91.7 91.9 90.9 90.9 C 92.4 91.2 91.6 91.0 D 91.8 92.2 92.0 91.4 E 93.1 92.9 92.4 92.4 Old Data Format 1 2 3 4 Car Gas A 91.7 91.2 90.9 90.6 B 91.7 91.9 90.9 90.9 C 92.4 91.2 91.6 91.0 D 91.8 92.2 92.0 91.4 E 93.1 92.9 92.4 92.4 Gas

20 20 Recall: Sum-of-Squares Identity 1-Factor ANOVA - new notation for Chapter 15 In words: T otal SS = SS for “treatments” + SS for “error”

21 21 A New Sum-of-Squares Identity In words: T otal SS = SS for treatments + SS for blocks + SS for error

22 22 Hypotheses: To test for treatment effects - i.e. gas differences we test To test for block effects - i.e. car differences (not usually the research hypothesis) we test

23 23 Randomized Complete Block Design ANOVA Table Source SS df MS F Treatments SST t  1 Blocks SSB Error SSE Total TSS bt  See page 866

24 24 Test for Treatment Effects Note:

25 25 Test for Block Effects

26 26 The first variable (A - E) indicates gas as it did with the Completely Randomized Design. The second variable (B1 - B4) indicates car. A B1 91.7 A B2 91.2 A B3 90.9 A B4 90.6 B B1 91.7 B B2 91.9 B B3 90.9 B B4 90.9 C B1 92.4 C B2 91.2 C B3 91.6 C B4 91.0 D B1 91.8 D B2 92.2 D B3 92.0 D B4 91.4 E B1 93.1 E B2 92.9 E B3 92.4 E B4 92.4 “Restructured” CAR Data - SAS Format

27 27 SAS file - Randomized Complete Block Design for CAR Data INPUT gas$ block$ octane; PROC GLM; CLASS gas block; MODEL octane=gas block; TITLE 'Gasoline Example -Randomized Complete Block Design'; MEANS gas/LSD; RUN;

28 28 CRD ANOVA Table Output - car data Source SS df MS F p-value Gas 6.108 4 1.527 6.80 0.0025 (treatments) Error 3.370 15 0.225 Totals 9.478 19

29 29 RCB ANOVA Table Output - car data Source SS df MS F p-value Gas 6.108 4 1.527 15.58 0.0001 (treatments) Cars 2.194 3 0.731 7.46 0.0044 (blocks) Error 1.176 12 0.098 Totals 9.478 19

30 30 Dependent Variable: OCTANE Sum of Mean Source DF Squares Square F Value Pr > F Model 7 8.30200000 1.18600000 12.10 0.0001 Error 12 1.17600000 0.09800000 Corrected Total 19 9.47800000 R-Square C.V. Root MSE OCTANE Mean 0.875923 0.341347 0.3130495 91.710000 Source DF Anova SS Mean Square F Value Pr > F GAS 4 6.10800000 1.52700000 15.58 0.0001 BLOCK 3 2.19400000 0.73133333 7.46 0.0044 SAS Output -- RCB CAR Data

31 Multiple Comparisons in RCB Analysis

32 32

33 33 t Grouping Mean N gas A 92.7000 4 E B 91.8500 4 D B C B 91.5500 4 C C B C B 91.3500 4 B C C 91.1000 4 A t Grouping Mean N gas A 92.7000 4 E B 91.8500 4 D B C B 91.5500 4 C C C 91.3500 4 B C C 91.1000 4 A CAR Data -- LSD Results CRD Analysis RCB Analysis

34 34 Bon Grouping Mean N gas A 92.7000 4 E A B A 91.8500 4 D B B 91.5500 4 C B B 91.3500 4 B B B 91.1000 4 A CAR Data -- Bonferroni Results CRD Analysis RCB Analysis Bon Grouping Mean N gas A 92.7000 4 E B 91.8500 4 D B B 91.5500 4 C B B 91.3500 4 B B B 91.1000 4 A

35 35 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.

36 36.204.257.170.279.181.269.167.283.182.235.187.260.202.256.198.281.236.258 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

37 37 Observed data Level of Factor A Level of Factor B Replication (warning type) (time) (response time) Stimulus Data

38 38 Factor A Factor B 2-Factor ANOVA Data

39 39

40 40 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

41 41 Auditory Visual 5 10 15 Hypothetical Cell Means

42 42 Similarly i.e. the model says We may not want to make these assumptions!!

43 43 Auditory Visual 5 10 15 Hypothetical Cell Means Auditory Visual 5 10 15

44 44 Model for 2-factor Design where

45 45 Sum-of-Squares Breakdown (2-factor ANOVA) SSA SSB SSAB SSE

46 46 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

47 47 ***************************************************** * Two-Way ANOVA using PROC GLM * * showing Interaction Plots * ***************************************************** ; data stimulus; input type$ time response; datalines; A 5.204 A 5.170 A 5.181 A 10.167 A 10.182 A 10.187 A 15.202 A 15.198 A 15.236 V 5.257 V 5.279 V 5.269 V 10.283 V 10.235 V 10.260 V 15.256 V 15.281 V 15.258 ; PROC GLM; CLASSES type time; MODEL response=type time type*time; TITLE ‘Stimulus Data'; run; PROC SORT;BY type time; PROC MEANS; BY type time; OUTPUT OUT=cells MEAN=response; RUN; * OUTPUT MEAN INTERACTION PLOTS; PROC GPLOT; PLOT response*type=time; SYMBOL1 V=CIRCLE I=JOIN C=BLACK; SYMBOL2 V=DOT I=JOIN C=BLACK; symbol3 V=BOX I=JOIN C=BLACK; RUN; PROC GPLOT; PLOT response*time=type; SYMBOL1 V=CIRCLE I=JOIN C=BLACK; SYMBOL2 V=DOT I=JOIN C=BLACK; RUN; PROC PRINT; RUN;

48 48 ***************************************************** * Two-Way ANOVA using PROC GLM * showing Interaction Plots ***************************************************** ; data stimulus; input type$ time response; datalines; A 5.204 A 5.170 A 5.181 A 10.167 A 10.182 A 10.187 A 15.202 A 15.198 A 15.236 V 5.257 V 5.279 V 5.269 V 10.283 V 10.235 V 10.260 V 15.256 V 15.281 V 15.258 ; PROC GLM; CLASSES type time; MODEL response=type time type*time; TITLE ‘Stimulus Data'; run;

49 49 Stimulus Data The GLM Procedure Dependent Variable: response Sum of Source DF Squares Mean Square F Value Pr > F Model 5 0.02554894 0.00510979 17.66 <.0001 Error 12 0.00347200 0.00028933 Corrected Total 17 0.02902094 R-Square Coeff Var Root MSE response Mean 0.880362 7.458622 0.017010 0.228056 Source DF Type I SS Mean Square F Value Pr > F type 1 0.02354450 0.02354450 81.38 <.0001 time 2 0.00115811 0.00057906 2.00 0.1778 type*time 2 0.00084633 0.00042317 1.46 0.2701 GLM Output

50 50 PROC SORT;BY type time; PROC MEANS; BY type time; OUTPUT OUT=cells MEAN=response; RUN;

51 51 ---------------------------------------- type=A time=5 ---------------------------------- The MEANS Procedure Analysis Variable : response N Mean Std Dev Minimum Maximum ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ 3 0.1850000 0.0173494 0.1700000 0.2040000 ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ ---------------------------------------- type=A time=10 --------------------------------- Analysis Variable : response N Mean Std Dev Minimum Maximum ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ 3 0.1786667 0.0104083 0.1670000 0.1870000 ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ ---------------------------------------- type=A time=15 --------------------------------- Analysis Variable : response N Mean Std Dev Minimum Maximum ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ 3 0.2120000 0.0208806 0.1980000 0.2360000 ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ ---------------------------------------- type=V time=5 ---------------------------------- Analysis Variable : response N Mean Std Dev Minimum Maximum ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ 3 0.2683333 0.0110151 0.2570000 0.2790000 ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ ---------------------------------------- type=V time=10 --------------------------------- The MEANS Procedure Analysis Variable : response N Mean Std Dev Minimum Maximum ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ 3 0.2593333 0.0240069 0.2350000 0.2830000 ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ ---------------------------------------- type=V time=15 --------------------------------- Analysis Variable : response N Mean Std Dev Minimum Maximum ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ 3 0.2650000 0.0138924 0.2560000 0.2810000 ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ PROC MEANS Output

52 52 Stimulus Data Obs type time _TYPE_ _FREQ_ response 1 A 5 0 3 0.18500 2 A 10 0 3 0.17867 3 A 15 0 3 0.21200 4 V 5 0 3 0.26833 5 V 10 0 3 0.25933 6 V 15 0 3 0.26500 PROC PRINT Output (dataset CELLS) PROC SORT;BY type time; PROC MEANS; BY type time; OUTPUT OUT=cells MEAN=response; RUN; PROC PRINT; RUN;

53 53 Stimulus Data Obs type time response 1 A 5 0.204 2 A 5 0.170 3 A 5 0.181 4 A 10 0.167 5 A 10 0.182 6 A 10 0.187 7 A 15 0.202 8 A 15 0.198 9 A 15 0.236 10 V 5 0.257 11 V 5 0.279 12 V 5 0.269 13 V 10 0.283 14 V 10 0.235 15 V 10 0.260 16 V 15 0.256 17 V 15 0.281 18 V 15 0.258 PROC PRINT Output (dataset STIMULUS) PROC PRINT data=stimulus; RUN;

54 54 Stimulus Data * OUTPUT MEAN INTERACTION PLOTS; PROC GPLOT DATA=cells; PLOT response*type=time; SYMBOL1 V=CIRCLE I=JOIN C=BLACK; SYMBOL2 V=DOT I=JOIN C=BLACK; SYMBOL3 V=BOX I=JOIN C=BLACK; RUN;

55 55 Stimulus Data * OUTPUT MEAN INTERACTION PLOTS; PROC GPLOT DATA=cells; PLOT response*time=type; SYMBOL1 V=CIRCLE I=JOIN C=BLACK; SYMBOL2 V=DOT I=JOIN C=BLACK; RUN;

56 56 Stimulus Data

57 57 Lab Assignment Run a 2-factor ANOVA on the Pilot Plant Data a. Print ANOVA Table b. Graph Interaction Plots c. Plot Histogram and Probability Plot of Residuals i. using standard GCHART and UNIVARIATE procedures ii. using Analyst http://support.sas.com/techsup/sample/sample_graph.html http://support.sas.com/documentation/onlinedoc/sas9doc.html SAS Online Resources

58 58 Pilot Plant Data Variable = Chemical Yield Factors:A – Temperature (160, 180) B – Catalyst (C1, C2) 160 C1 59 160 C1 61 160 C1 50 160 C1 58 180 C1 74 180 C1 70 180 C1 69 180 C1 67 160 C2 50 160 C2 54 160 C2 46 160 C2 44 180 C2 81 180 C2 85 180 C2 79 180 C2 81


Download ppt "1 Experimental Statistics - week 6 Chapter 15: Randomized Complete Block Design (15.3) Factorial Models (15.5)"

Similar presentations


Ads by Google