Unreplicated Factorial Experiments

/*--------------------------------------------------------------

                    SAS Sample Library

        Name: entex02.sas
 Description: Example program from SAS/ETS User's Guide,
              The ENTROPY Procedure
       Title: Unreplicated Factorial Experiments
     Product: SAS/ETS Software
        Keys: Generalized Maximum Entropy
        PROC: ENTROPY
       Notes:

--------------------------------------------------------------*/

data rate;
   do a=-1,1; do b=-1,1; do c=-1,1; do d=-1,1;
      input y @@;
      ab=a*b; ac=a*c; ad=a*d; bc=b*c; bd=b*d; cd=c*d;
      abc=a*b*c; abd=a*b*d; acd=a*c*d; bcd=b*c*d;
      abcd=a*b*c*d;
      output;
   end; end; end; end;
   datalines;
   45 71 48 65 68 60 80 65 43 100 45 104 75 86 70 96
   ;
run;

proc reg data=rate outest=regout;
   model y=a b c d ab ac ad bc bd cd abc abd acd bcd abcd;
run;

proc transpose data=regout out=ploteff name=effect prefix=est;
   var a b c d ab ac ad bc bd cd abc abd acd bcd abcd;
run;

proc rank data=ploteff normal=blom out=qqplot;
   var est1;
   ranks normalq;
run;

title "Unreplicated Factorial Experiments";
proc sgplot data=qqplot;
   scatter x=est1 y=normalq / markerchar=effect
                              markercharattrs=(size=10pt);
   xaxis label="Estimate";
   yaxis label="Normal Quantile";
run;

proc reg data=rate;
   model y=a b d ad bd;
run;

proc entropy data=rate;
   model y=a b c d ab ac ad bc bd cd abc abd acd bcd abcd;
run;