Central Composite Design
 
 You can enter the data in any way you want.
 proc factex;
  factors x1 x2;
  output out=part1;
 run;

 %adxgen
 %adxff
 %adxcc
 %adxinit
 %adxadcen(part1,x1 x2,5);

 data part2;
  input y @@;
  datalines;
  39.3 40.0 40.9 41.5 40.3 40.5 40.7 40.2 40.6
  ;

 data time;
  merge part1 part2;
 run;


data ccd;
  input zi1 zi2 yield @@;
  datalines;
  80 170 76.5
  80 180 77
  90 170 78
  90 180 79.5
  85 175 79.9
  85 175 80.3
  85 175 80.0
  85 175 79.7
  85 175 79.8
  92.07 175 78.4
  77.93 175 75.6
  85 182.07 78.5
  85 167.93 77
  ;
Use PROC RSREG to analyse this dataset.(Example-11.2,Montogomery) proc rsreg data=ccd out=resout noprint; "resout" contains residuals and predcited values model yield = zi1 zi2/lackfit predict residual; ridge max outr=rout; "rout" contains predcited value,std err etc. run; In the above code, LACKFIT option provides a test for lack of fit. ie. H(0) : "model is good" vs H(1) : "model is not good". So if H(0) is rejected for small value of p-value then it means that quadratic model is not a good fit. you can also see that if the model is good fit then, R-square should be very high.

 Contour plot and Surface Plot

 proc sort data=resout;
  by _TYPE_;
 run;  

   proc g3grid data=resout out=gout;
    by _TYPE_;
    grid zi1*zi2=yield/naxis1=31 naxis2=31 ;
  run;

  proc gcontour data=gout;
   by _TYPE_;
   plot zi1*zi2=yield/grid autolabel;
  run;

 proc g3d data=gout;
   by _TYPE_;
   plot zi1*zi2=yield/grid;
  run;

 quit;
 

  Using PROC GLM 

  proc glm data=ccd;
   model yield= zi1 zi2 zi1*zi2/ss1;
   output out=resout r=resid p=predict;
  run;

 For getting a Goodness of Fit Statistics
 use the first line of the Anova(over all 
 ANOVA) this tests for the model fitting..

 
Hosted by www.Geocities.ws

1