Note: See Two-Level Full Factorial Design in the SAS/QC Sample Library.
This example introduces the basic syntax used with the FACTEX procedure.
An experimenter is interested in studying the effects of three factors—cutting speed (Speed
), feed rate (FeedRate
), and tool angle (Angle
)—on the surface finish of a metallic part and decides to run a complete factorial experiment with two levels for each factor
as follows:
Factor |
Low Level |
High Level |
---|---|---|
Cutting speed |
300 |
500 |
Feed rate |
20 |
30 |
Tool angle |
6 |
8 |
This is a factorial design—in other words, a complete factorial experiment with three factors, each at two levels. Hence there are eight runs in the experiment. Since complete factorial designs have full resolution, all of the main effects and interaction terms can be estimated. For a definition of the design resolution, see the section Resolution.
You can use the following statements to create the required design:
proc factex; factors Speed FeedRate Angle; examine design; run;
These statements invoke the FACTEX procedure, list factor names, and display the generated design points. By default, the FACTEX procedure assumes that the size of the design is a full factorial and that each factor has only two levels.
After you submit the preceding statements, you see the following messages in the SAS log:
NOTE: No design size specified. Default is a full replicate in 8 runs. NOTE: Design has 8 runs, full resolution.
The output is shown in Figure 7.1. The two factor levels are represented by the coded values –1 and +1.
If you prefer to work with the actual (decoded) values of the factors, you can specify these values in an OUTPUT OUT= statement, as follows:
proc factex; factors Speed FeedRate Angle; output out=SavedDesign Speed nvals=(300 500) FeedRate nvals=(20 30) Angle nvals=(6 8); run; proc print; run;
The OUTPUT statement in PROC FACTEX recodes the factor levels and saves the constructed design in the SavedDesign
data set. Since the levels in this example are of numeric type, you use the NVALS= option to list the factor levels. Optionally,
you can use the CVALS= option for levels of character type (see the section Example of a Full Factorial Design in Two Blocks). The design is saved in a user-specified output data set (SavedDesign
). This is verified by the following message in the SAS log:
NOTE: The data set WORK.SAVEDDESIGN has 8 observations and 3 variables.
Figure 7.2 shows a listing of the data set SavedDesign
.
Although small complete factorial designs are not difficult to create manually, you can easily extend this example to construct a design with many factors.