/**********************************************************************/ /* Atkinson, Donev, and Tobias, "Optimum Experimental Designs" */ /* */ /* NAME: Program 19.4 */ /* TITLE: SAS Task 19.1 - Augmenting a second-order design to third */ /* order */ /* KEYS: */ /* DATA: */ /* */ /* Author: Randy Tobias */ /* History: */ /* Created...............................................27Jun2007 */ /**********************************************************************/ title1 "SAS Task 19.1 - Augmenting a second-order design to third order"; title2 "Figure 19.1 - 13-trial D-optimum third-order design"; /* / Create 4x4 candidate grid over [-1,1]**2. /---------------------------------------------------------------------*/ proc factex; factors x1-x2 / nlev=4; output out=Can3; data Can3; set Can3; x1 = 2*(x1/3) - 1; x2 = 2*(x2/3) - 1; run; /* / Select and print 13 runs D-optimally. /---------------------------------------------------------------------*/ proc optex data=Can3 seed=2 coding=orthcan; model x1 x2 x1*x1 x1*x2 x2*x2 x1*x1*x1 x1*x1*x2 x1*x2*x2 x2*x2*x2; generate n=13 method=m_fedorov niter=1000 keep=10; output out=Order3; proc print data=Order3; run; title2; title2 "Augmenting a second-order design to a third-order design"; /* / The optimum 9-point, second-order design is the 3x3 grid on / [-1,1]**2. /---------------------------------------------------------------------*/ proc factex; factors x1-x2 / nlev=3; output out=Order2; data Order2; set Order2; Source = "Order2"; run; /* / Use the AUGMENT= option in OPTEX to add points to Order2 for / fitting the third-order model. /---------------------------------------------------------------------*/ proc factex; factors x1-x2 / nlev=4; output out=Can3; data Can3; set Can3; Source = "Can3 "; x1 = 2*(x1/3) - 1; x2 = 2*(x2/3) - 1; proc optex data=Can3 coding=orthcan; model x1 x2 x1*x1 x1*x2 x2*x2 x1*x1*x1 x1*x1*x2 x1*x2*x2 x2*x2*x2; generate n=13 augment=Order2 method=m_fedorov niter=1000 keep=10; id Source; output out=Aug23; proc sort data=Aug23; by Source x1 x2; proc print data=Aug23; var Source x1 x2; run; title2; title2 "Including SOURCE as a block variable"; proc optex data=Can3; class Source; model Source x1 x2 x1*x1 x1*x2 x2*x2 x1*x1*x1 x1*x1*x2 x1*x2*x2 x2*x2*x2; generate n=13 augment=Order2 method=m_fedorov niter=1000 keep=10; output out=Blk23; proc sort data=Blk23; by Source x1 x2; proc print data=Blk23; var Source x1 x2; run; title2; title1;