/**********************************************************************/ /* Atkinson, Donev, and Tobias, "Optimum Experimental Designs" */ /* */ /* NAME: Program 15.4 */ /* TITLE: SAS Task 15.2 - Trend-free second-order design */ /* KEYS: */ /* DATA: */ /* NOTES: Uses a macro that is similar to, but not the same as, the */ /* one in Program 15.1. */ /* */ /* Author: Randy Tobias */ /* History: */ /* Created...............................................27Jun2007 */ /**********************************************************************/ title1 "SAS Task 15.2 - Trend-free second-order design"; /* / Create time-trend-free second-order design, as discussed in the / text. /---------------------------------------------------------------------*/ data Candidates; do x1 = -1 to 1; do x2 = -1 to 1; output; end; end; data Runs; do Time = 1 to 9; output; end; run; title2 "Efficiencies for optimal design"; proc optex data=Candidates coding=orthcan; model x1 x2 x1*x2 x1*x1 x2*x2; block design=Runs niter=1000 keep=10; model Time; output out=Design; run; title2; /* / Create variables for second-order terms. /---------------------------------------------------------------------*/ data Design; set Design; x1x2 = x1*x2; x1x1 = x1*x1; x2x2 = x2*x2; run; /* / Use PROC CORR to compute and display correlations between Time / and all first- and second-order terms. /---------------------------------------------------------------------*/ title2 "Time trends"; proc corr data=Design; var x1 x2 x1x2 x1x1 x2x2; with Time; ods select PearsonCorr; run; title2; title1;