Presentation is loading. Please wait.

Presentation is loading. Please wait.

Latin Squares (Kirk, chapter 8) BUSI 6480 Lecture 7.

Similar presentations


Presentation on theme: "Latin Squares (Kirk, chapter 8) BUSI 6480 Lecture 7."— Presentation transcript:

1 Latin Squares (Kirk, chapter 8) BUSI 6480 Lecture 7

2

3 Example: Number of Combinations of Factor Levels May Be Too Large

4 Fewer Combinations of Factor Levels Without Bias

5 Treatment Levels Always Appear Once In Each Row and Column

6 Sums of Squares For One Observation Per Cell (for more than one obs. per cell use Table 8.3-1, p. 326)

7 Blocks may be Treatments of interest as well

8 Another Example of a Latin Square Design  Main Factor – Evaluate Perceived Attractiveness of 4 types of Animation on Web Pages  Nuisance Factor 1 – Four Web Designs  Nuisance Factor 2 – Four Color Patterns  Subjects can be assigned to factor level combinations. But note that 4X4X4 = 64.  Two subjects to each combination is 128 for all combinations.  Easier to use a Latin Square with 16X2 = 32 subjects.

9 Model for Latin Square with n Subjects Per Cell  Y ijkl =  +  j +  k +  l +  jkl +  i(jkl)  (i = 1,..., n; j = 1,..., p;  k = 1,..., p; l = 1,..., p)  Note: n represents number of obs. per cell.  p is usually used to represent factor levels Looks like a three factor model with only main effects. But not all factor level combinations are observed.

10 Within-Subjects and Between-Subjects Designs  If Subjects are assigned to each cell, then the design is a between-subjects design.  If Subjects are assigned so that they a subject is tested across the levels of a factor then the design is a within-subject design. This design can also be called a repeated measures design, especially if measurements are repeated over time.

11 Examples of Latin Squares: 2 x 2 design  Note: 1 could be replaced by the letter A and 2 could be replaced by the letter B. Then, the first design would become: AB BA

12 Examples of Latin Squares 3 x 3 (12 in total). First One is a “Standard” Square.

13 Critisism: Asymmetric Skill Transfer  A criticism of Latin Squares is that there may be learning effects that may account for significance of factors.  Because of the cyclic ordering of the levels, there is some counterbalancing that helps to mitigate learning effects.  Also, there should be a sufficient time delay between administration of the treatment combinations to offset learning.

14 Look at Patterns – B always follows A

15 Completely Balanced Designs Do Not Exist for p=Odd

16 Computational Example

17 Initial Computations Using [ ] Notation

18 Set up ANOVA Table with SS below and compute MSs and Fs Pooled MSRES is recommended.

19 SAS PROC PLAN TO GET RANDOM LATIN SQ DESIGN  DM "Log;Clear;OUT;Clear;" ;  options pageno=min nodate formdlim='-';  title 'Latin Square Design';  proc plan seed=37430;  factors rows=4 ordered cols=4 ordered;  treatments tmts=4 cyclic;  output out=myoutput  rows cvals=('Day 1' 'Day 2' 'Day 3' 'Day 4') random  cols cvals=('Lab 1' 'Lab 2' 'Lab 3' 'Lab 4') random  tmts nvals=( 1 2 3 4 ) random;  run;  proc print data = myoutput;  proc tabulate data = myoutput;  class rows cols;  var tmts;  table rows, cols*(tmts*f=6.) / rts=8; /* f controls length of cell for tmts */  run; /* rts stands for row title space */  quit;

20 Output from Proc Plan  Latin Square Design The PLAN Procedure  Plot Factors  Factor Select Levels Order  rows 4 4 Ordered  cols 4 4 Ordered  Treatment Factors  Initial Block  Factor Select Levels Order Increment  tmts 4 4 Cyclic (1 2 3 4)  rows --cols- --tmts-  1 1 2 3 4 1 2 3 4  2 1 2 3 4 2 3 4 1  3 1 2 3 4 3 4 1 2  4 1 2 3 4 4 1 2 3

21 Assigning Treatments To Latin Square

22 SPSS Latin Square  Put Data in usual column format specifying three fixed or random effects.  Select main effects only under Model option.  Usually only the main treatment is selected in doing post hoc multiple comparisons, but other treatments can be selected.  Use Analyze > General Linear Model > Univariate.  Check observed power on Options for power figures.

23 SAS: Use Proc Glm – Same as for Randomized Block Designs, except there is an additional treatment Note Tukey option for this example  proc glm data=MyLatinSqData;  class Treat_a Treat_c Treat_b;  model y = Treat_a Treat_c Treat_b;  means Treat_a/Tukey;  run; If a treatment, say Treat_c, is random then after model statement insert: random Treat_c ;

24 SAS: Proc GLMPower  Use input column format data set.  proc glmpower data = LatinSqData;  class Treat_a Treat_b Treat_c;  model y = Treat_a Treat_b Treat_c;  contrast "1 vs 2" Treat_a 1 -1 0;  power stddev = 1.0445 /*Insert sqrt(MSE) or estimate of stddev*/  ntotal = 32 /*insert sample size*/  power =.; NOTE: Tang Charts in back of Kirk textbook can be used to obtain approximate power numbers similar to procedure for CRD or RBD models.

25 Relative Efficiency of Latin Square and Randomized Block Design  RE =  ((dfRES(LS) +1)/(dfRES(LS) +3))* (((p-1)^2 + 3)/((p-1)^2 + 1))* (MSRES(RB) / MSRES(LS)) This formula can be used to determine sample size in LS relative to that of RB similar to the procedure with RB and CRD. Note that MSRES(RB) needs to be estimated by (MSB + (p-1)MSRES(LS)/p) where C would represent the block factor. B and C could be switched depending on which factor represents the block factor in the RBD.

26 Crossover Design  Crossover designs have features of randomized block and Latin square designs.  Can be thought of as a stacked Latin square design.  As in a Latin square design, each treatment level occurs an equal number of times in each time period.  Effects of two “nuisance” variables – typically blocks and time can be isolated.

27 SAS: Reading In Latin Square Data Need Two Data Sets Actual Data here Design here

28 SAS Statements to Merge Data  PROC IMPORT OUT= WORK.MyData  DATAFILE= "D:\Data Example for LatinSq.xls"  DBMS=EXCEL2000 REPLACE;  RANGE="MyData$";  GETNAMES=Yes;  RUN;  proc print;  PROC IMPORT OUT= WORK.MyDesign  DATAFILE= "D:\Data Example for LatinSq.xls"  DBMS=EXCEL2000 REPLACE;  RANGE="MyDesign$";  GETNAMES=Yes;  RUN;  Proc print;  data combine;  merge MyData MyDesign;  proc print data = Combine;

29 SAS: Output of Merged Data Set Obs c1 c2 c3 Treat_b ac1 ac2 ac3 1 61 49 52 1 1 2 3 2 52 53 34 2 2 3 1 3 40 43 36 3 3 1 2

30 SAS: Statements to put in column Format. Note use of Arrays because of Do Loop  Data LatinSqData;  set combine;  Array c[3] c1-c3;  Array ac[3] ac1-ac3;  p = 3;  Do I = 1 to p;  y = c[I]; Treat_a = ac[I]; Treat_c = I; output;  End;  Keep y Treat_a Treat_b Treat_c;

31 SAS: An Alternative Approach to Creating Columns – No Do Loop  data alterColFormatforshortDataSets;  set combine;  y = c1; Treat_c = 1; Treat_a = ac1; output;  y = c2; Treat_c = 2; Treat_a = ac2; output;  y = c3; Treat_c = 3; Treat_a = ac3; output;  Keep y Treat_a Treat_b Treat_c;

32 For more than one observation per cell  Data MyDesign;  set MyDesign;  n=10; /* number of obs per cell */  Do i = 1 to n;  output;  end;  Drop n i; The output statement in the Do Loop increases the number of replications in the design.

33 HW7:Kirk, Ex. 7 Page 357  Work Parts a, b, c, d, and g.  Reword part g to: Determine the efficiency of the randomized block design relative to the Latin Square. Assume that the blocks for the RBD is factor C.  Assume that the graduate students and the groups with similar subjects with respect to noun recognition are random effects.  In addition, get the power for the contrast between a1 and a2  Use SPSS.


Download ppt "Latin Squares (Kirk, chapter 8) BUSI 6480 Lecture 7."

Similar presentations


Ads by Google