/**********************************************************************/ /* Atkinson, Donev, and Tobias, "Optimum Experimental Designs" */ /* */ /* NAME: Program 16.7 */ /* TITLE: Fig. 16.7 & 16.8. 16-trial D-optimum designs in 6 blocks */ /* for a 4-component mixture */ /* KEYS: */ /* DATA: */ /* NOTES: Uses the ADX macros to create simplex lattice designs. */ /* */ /* Author: Randy Tobias */ /* History: */ /* Created...............................................27Jun2007 */ /**********************************************************************/ title1 "16-trial D-optimum designs in 6 blocks for a 4-component mixture"; %adxgen; %adxmix; /* / Using just the order 2 simplex lattice design as a candidate set / matches the results given in the text. Running with higher orders / finds slightly better optimum designs. /---------------------------------------------------------------------*/ %let Order = 2; %adxsld(Candidates,x1 x2 x3 x4,&Order); /* / Experience shows that only mixtures with one or two non-zero / components are needed in the optimum design. The order 2 simplex / lattice design contains only such points, but if you explore using / different orders, this step will speed up the search considerably. /---------------------------------------------------------------------*/ data Candidates; set Candidates; where ((x1=0) + (x2=0) + (x3=0) + (x4=0) >= 2); run; /* / Create rows and columns that have an approximately even allocation / of the observations between the blocks. /---------------------------------------------------------------------*/ data Blocks; do Row = 1 to 2; do Column = 1 to 3; if (Column < 3) then do Rep = 1 to 3; output; end; else do Rep = 1 to 2; output; end; end; end; run; /* / Create the design of Figure 16.7 in a data set. /---------------------------------------------------------------------*/ data Fig1607; input Row Column x1 x2 x3 x4; x1 = x1/2; x2 = x2/2; x3 = x3/2; x4 = x4/2; cards; 1 1 0 0 0 2 1 1 0 1 0 1 1 1 0 1 1 0 1 2 0 0 2 0 1 2 0 0 1 1 1 2 1 0 1 0 1 3 1 0 0 1 1 3 1 1 0 0 2 1 2 0 0 0 2 1 1 0 0 1 2 1 0 0 1 1 2 2 0 2 0 0 2 2 1 1 0 0 2 2 0 1 0 1 2 3 0 1 1 0 2 3 1 0 1 0 ; /* / Find the optimum design and save its efficiencies, and also save / the efficiencies for the design from the text. /---------------------------------------------------------------------*/ ods listing close; proc optex data=Candidates coding=orthcan seed=12345678; model x1|x2|x3|x4@2 / noint; block design=Blocks niter=100 keep=1; class Row Column; model Row Column; ods output BlockDesignEfficiencies=BDEff1; output out=Design1607; run; proc optex data=Candidates coding=orthcan; model x1|x2|x3|x4@2 / noint; generate initdesign=Fig1607 method=sequential; block design=Blocks init=chain niter=0 noexchange; class Row Column; model Row Column; ods output BlockDesignEfficiencies=BDEff2; run; ods listing; data BDEff1; set BDEff1; Source = "OPTEX "; data BDEff2; set BDEff2; Source = "Goos and Donev"; data BDEff1607; set BDEff1 BDEff2; run; /* / Same as above, except that the rows and columns that have larger / blocks for the first level of one of the blocking factors. /---------------------------------------------------------------------*/ %adxsld(Candidates,x1 x2 x3 x4,&Order); data Candidates; set Candidates; where ((x1=0) + (x2=0) + (x3=0) + (x4=0) >= 2); run; data Blocks; do Row = 1 to 2; do Column = 1 to 3; if (Column < 2) then do Rep = 1 to 4; output; end; else do Rep = 1 to 2; output; end; end; end; run; data Fig1608; input Row Column x1 x2 x3 x4; x1 = x1/2; x2 = x2/2; x3 = x3/2; x4 = x4/2; cards; 1 1 0 0 0 2 1 1 0 1 0 1 1 1 0 1 1 0 1 1 0 0 2 0 1 2 0 0 1 1 1 2 1 0 1 0 1 3 1 0 0 1 1 3 1 1 0 0 2 1 2 0 0 0 2 1 1 0 0 1 2 1 0 0 1 1 2 1 0 2 0 0 2 2 1 1 0 0 2 2 0 1 0 1 2 3 0 1 1 0 2 3 1 0 1 0 ; ods listing close; proc optex data=Candidates coding=orthcan seed=12345678; model x1|x2|x3|x4@2 / noint; block design=Blocks niter=100 keep=1; class Row Column; model Row Column; ods output BlockDesignEfficiencies=BDEff1; output out=Design1608; run; proc optex data=Candidates coding=orthcan; model x1|x2|x3|x4@2 / noint; generate initdesign=Fig1608 method=sequential; block design=Blocks init=chain niter=0 noexchange; class Row Column; model Row Column; ods output BlockDesignEfficiencies=BDEff2; run; ods listing; data BDEff1; set BDEff1; Source = "OPTEX "; data BDEff2; set BDEff2; Source = "Goos and Donev"; data BDEff1608; set BDEff1 BDEff2; run; proc sort data=Design1607; by Row Column x1-x4; proc sort data=Design1608; by Row Column x1-x4; run; title2 "Optimum design being compared to Figure 16.7"; proc print data=Design1607 noobs; run; title2 "Optimum design being compared to Figure 16.8"; proc print data=Design1608 noobs; run; title2 "Efficiencies for designs with approximately balanced blocks"; proc print data=BDEff1607 noobs; var Source DCriterion ACriterion; run; title2 "Efficiencies for designs with unbalanced blocks"; proc print data=BDEff1608 noobs; var Source DCriterion ACriterion; run; title2; title1;