The PLAN Procedure

Example 87.7 Crossover Designs

(View the complete code for this example.)

In crossover experiments, the same experimental units or subjects are given multiple treatments in sequence, and the model for the response at any one period includes an effect for the treatment applied in the previous period. A good design for a crossover experiment is therefore one that balances how often each treatment is preceded by each other treatment. Cox (1992) gives the following example of a balanced crossover experiment for paper production. In this experiment, the subjects are production runs of the mill, with the treatments being six different concentrations of pulp used in sequence. The following statements construct this design in a standard form:

proc plan;
   factors Run=6 ordered Period=6 ordered;
   treatments Treatment=6 cyclic (1 2 6 3 5 4);
run;

Output 87.7.1 shows the results of the preceding statements.

Output 87.7.1: Crossover Design for Six Treatments

The PLAN Procedure

Plot Factors
FactorSelectLevelsOrder
Run66Ordered
Period66Ordered

Treatment Factors
FactorSelectLevelsOrderInitial Block / Increment
Treatment66Cyclic(1 2 6 3 5 4) / 1

RunPeriodTreatment
1123456126354
2123456231465
3123456342516
4123456453621
5123456564132
6123456615243


The construction method for this example is due to Williams (1949). The initial block for the treatment variable Treatment is defined as follows for n = 6:

This general form serves to generate a balanced crossover design for n treatments and n subjects in n periods when n is even. When n is odd, subjects are required, with the following initial blocks, respectively for odd and even n:

In order to randomize Williams’ crossover designs, the following statements randomly permute the subjects and treatments:

proc plan seed=136149876;
   factors Run=6 ordered Period=6 ordered / noprint;
   treatments Treatment=6 cyclic (1 2 6 3 5 4);
   output out=RandomizedDesign
      Run       random
      Treatment random
      ;
run;
/*
/ Relabel Period to obtain the same design as in Cox (1992).
/------------------------------------------------------------------*/
data RandomizedDesign;
   set RandomizedDesign;
   Period = mod(Period+2,6)+1;
run;
proc sort data=RandomizedDesign;
   by Run Period;
run;
proc transpose data=RandomizedDesign out=tDesign(drop=_name_);
   by notsorted Run;
   var Treatment;
run;
data tDesign;
   set tDesign;
   rename COL1-COL6 = Period_1-Period_6;
run;
proc print data=tDesign noobs;
run;

In the preceding statements, Run and Treatment are randomized by using the RANDOM option in the OUTPUT statement, and new labels for Period are obtained in a subsequent DATA step. This Period relabeling is not necessary and might not be valid for Williams’ designs in general; it is used in this example only to match results with those of Cox (1992). The SORT and TRANSPOSE steps then prepare the design to be printed in a standard form, shown in Output 87.7.2.

Output 87.7.2: Randomized Crossover Design

RunPeriod_1Period_2Period_3Period_4Period_5Period_6
1362541
2534612
3145263
4216435
5651324
6423156


The analysis of a crossover experiment requires for each observation a carryover variable whose values are the treatment in the preceding period. The following statements add such a variable to the randomized design constructed previously:

proc sort data=RandomizedDesign;
   by Run Period;
run;
data RandomizedDesign;
   set RandomizedDesign;
   by Run period;
   LagTreatment = lag(Treatment);
   if (first.Run) then LagTreatment = .;
run;

proc transpose data=RandomizedDesign out=tDesign(drop=_name_);
   by notsorted Run;
   var LagTreatment;
run;
data tDesign;
   set tDesign;
   rename COL1-COL6 = Period_1-Period_6;
run;
proc print data=tDesign noobs;
run;

Output 87.7.3 displays the values of the carryover variable for each run and period.

Output 87.7.3: Lag Treatment Effect in Crossover Design

RunPeriod_1Period_2Period_3Period_4Period_5Period_6
1.36254
2.53461
3.14526
4.21643
5.65132
6.42315


Of course, the carryover variable has no effect in the first period, which is why it is coded with a missing value in this case.

The LAG effect in the EFFECT statement in PROC ORTHOREG provides a convenient mechanism for incorporating the carryover effect into the analysis. The following statements first add the observed data to the design to create the Mills data set. Then PROC ORTHOREG is invoked, and the carryover effect is defined as a lag effect with the relevant period and subject information specified. ODS is used to trim down the results to show only the parts that are usually of interest in crossover analysis. For more information about the EFFECTS statement in PROC ORTHOREG, see the section EFFECT Statement in Chapter 85: The ORTHOREG Procedure.

data Responses;
   input Response @@;
   datalines;
56.7 53.8 54.4 54.4 58.9 54.5
58.5 60.2 61.3 54.4 59.1 59.8
55.7 60.7 56.7 59.9 56.6 59.6
57.3 57.7 55.2 58.1 60.2 60.2
53.7 57.1 59.2 58.9 58.9 59.6
58.1 55.7 58.9 56.6 59.6 57.5
;
data Mills;
   merge RandomizedDesign Responses;
run;
proc orthoreg data=Mills;
   class Run Period Treatment;
   effect CarryOver = lag(Treatment / period=Period within=Run);
   model Response = Run Period Treatment CarryOver;
   test Run Period Treatment CarryOver / htype=1;
   lsmeans Treatment CarryOver / diff=anom;
   ods select Tests1 LSMeans Diffs;
run;

Output 87.7.4 shows the carryover analysis that results from the preceding statements.

Output 87.7.4: Carryover Analysis for Crossover Experiment

The ORTHOREG Procedure
 
Dependent Variable: Response

Type I Tests of Model Effects
EffectNum DFDen DFF ValuePr > F
Run51513.76<.0001
Period5157.190.0013
Treatment51522.95<.0001
CarryOver5157.760.0009

Treatment Least Squares Means
TreatmentEstimateStandard ErrorDFt ValuePr > |t|
157.19540.322015177.65<.0001
257.62040.322015178.97<.0001
359.19190.322015183.85<.0001
459.22880.322015183.97<.0001
557.98290.322015180.10<.0001
655.06390.322015171.03<.0001

Differences of Treatment Least Squares Means
Treatment_TreatmentEstimateStandard ErrorDFt ValuePr > |t|
1Avg-0.51850.294815-1.760.0990
2Avg-0.093450.294815-0.320.7556
3Avg1.47800.2948155.010.0002
4Avg1.51490.2948155.140.0001
5Avg0.26900.2948150.910.3758
6Avg-2.65000.294815-8.99<.0001

CarryOver Least Squares Means
CarryOverEstimateStandard ErrorDFt ValuePr > |t|
1Non-est....
2Non-est....
3Non-est....
4Non-est....
5Non-est....
6Non-est....

Differences of CarryOver Least Squares Means
CarryOver_CarryOverEstimateStandard ErrorDFt ValuePr > |t|
1Avg0.37260.3284151.130.2743
2Avg-0.27740.328415-0.840.4116
3Avg0.65120.3284151.980.0660
4Avg-1.32740.328415-4.040.0011
5Avg1.39760.3284154.260.0007
6Avg-0.81670.328415-2.490.0252


The Type I analysis of variance indicates that all effects are significant—in particular, both the direct and the carryover effects of the treatment. In the presence of carryover effects, the LS-means need to be defined with some care. The LS-means for treatments computed using balanced margins for the carryover effect are inestimable; so the OBSMARGINS option is specified in the LSMEANS statement in order to use the observed margins instead. The observed margins take the absence of a carryover effect in the first period into account. Note that the LS-means themselves of the carryover effect are inestimable, but their differences are estimable. The LS-means of the direct effect of the treatment and the ANOM differences for the LS-means of their carryover effect match the "adjusted direct effects" and "adjusted residual effects," respectively, of Cox (1992).