The FACTEX Procedure |
You use the OUTPUT statement to save a design in an output data set. Optionally, you can use the OUTPUT statement to modify the design by specifying values to be output for factors, creating new factors, randomizing the design, and replicating the design. You specify the output data set as follows:
gives the name of the output data set in which the design is saved. Note that OUT= is required.
recode the values for design factors
recode the values for the block variable
replicate the entire design
replicate each point of the design
randomize the design
create derived factors based on the original factors
The following list describes the preceding options:
By default, the output data set contains a variable for each factor in the design coded with standard values, as follows:
For factors with 2 levels (), the values are and +1.
For factors with 3 levels (), the values are , 0, and +1.
For factors with levels (), the values are .
You can recode the levels of the factor from the standard levels to levels appropriate for your situation.
For example, suppose that you want to recode a three-level factorial design from the standard levels , 0, and +1 to the actual levels. Suppose the factors are pressure (Pressure) with character levels, agitation rate (Rate) with numeric levels, and temperature (Temperature) with numeric levels. You can use the following statement to recode the factor levels and save the design in a SAS data set named RECODE:
output out=recode Pressure cvals=('low' 'medium' 'high') Rate nvals=(20 40 60) Temperature cvals=(100 150 200);
The general form of options to recode factors is as follows:
or
where
gives the name of the design factor.
lists new numeric levels for design factors.
lists new character levels for design factors. Each string can be up to 40 characters long.
When recoding a factor, the NVALS= and CVALS= options map the first value listed to the lowest value for the factor, the second value listed to the next lowest value, and so on. If you rename and recode a factor, the type and length of the new variable are determined by whether you use the CVALS= option (character variable with length equal to the longest string) or the NVALS= option (numeric variable). For more on recoding a factor, see Factor Variable Characteristics in the Output Data Set.
If the design uses blocking, the output data set automatically contains a block variable named BLOCK, and for a design with blocks, the default values of the block variable are . You can rename the block variable and optionally recode the block levels from the default levels to levels appropriate for your situation.
For example, for a design arranged in four blocks, suppose that the block variable is day of the week (Day) and that the four block levels of character type are Mon, Tue, Wed, and Thu. You can use the following statement to rename the block variable, recode the block levels, and save the design in a SAS data set named RECODE:
output out=recode blockname=Day cvals=('Mon''Tue''Wed''Thu');
The general form of options to change the block variable name or change the block levels is as follows:
or
where
gives a new name for the block factor.
lists new numeric levels for the block factor. For details, see the section Recode Design Factors.
lists new character levels for the block factor. For details, see the section Recode Design Factors.
Note that you can simply rename the block variable by using only the BLOCKNAME= option, without using the NVALS= and CVALS= options.
replicates the entire design. Specify DESIGNREP= to replicate the design times, where is an integer. Alternatively, you can specify a SAS data set with the DESIGNREP option. In this case, the design is replicated once for each point in the DESIGNREP= data set, and the OUT= data set contains the variables in the DESIGNREP= data set as well as the design variables.
In mathematical notation, the OUT= data set is the direct product of the DESIGNREP= data set and the design. If the design is a and the DESIGNREP= data set is b, then the OUT= data set is c a, where denotes the direct product.
For details, see the section Replication. For illustrations of the difference between the DESIGNREP= and POINTREP= options, see Example 7.6 and Example 7.7.
replicates each point of the design. Specify POINTREP= to replicate each design point times, where is an integer. Alternatively, you can specify a SAS data set with the POINTREP= option. In this case, the POINTREP= data set is replicated once for each point in the design and the OUT= data set contains the variables in the POINTREP= data set as well as the design variables.
In mathematical notation, the OUT= data set is the direct product of the design and the POINT= data set. If the design is a and the POINTREP= data set is b, then the OUT= data set is a b, where denotes the direct product.
For details, see the section Replication. For illustrations of the difference between the DESIGNREP= and POINTREP= options, see Example 7.6 and Example 7.7.
randomizes the design. See the section Randomization for details. The following options are available:
specifies an integer used to start the pseudo-random number generator for randomizing the design. The value of must be enclosed in parentheses immediately after the keyword RANDOMIZE. If you do not specify a seed, or if you specify a value less than or equal to zero, the seed is by default generated from reading the time of day from the computer’s clock.
prevents the randomization of theoretical factor levels to actual levels. The randomization of run order is still performed.
You can create derived factors based on the joint values of a set of the design factors. Each distinct combination of levels of the design factors corresponds to a single level for the derived factor. Thus, when you create a derived factor from design factors, each with levels, the derived factor has levels. Derived factors are useful when you create mixed-level designs; see Example 7.8 for an example. See the section Structure of General Factorial Designs for information on how the levels of design factors are mapped into levels of the derived factor. The general form of the option for creating derived factors is
or
where
gives names of factors currently in the design. These factors are combined to create the new derived factor.
gives a name to the new derived factor. This name must not be used in the design.
lists new numeric levels for the derived factor.
lists new character levels for the derived factor. See the section Recode Design Factors for details.
If you create a derived factor and do not use the NVALS= or CVALS= option to assign levels to the derived factor, the FACTEX procedure assigns the values , where the derived factor is created from design factors, each with levels. In general, the CVALS= or NVALS= list for a derived factor must contain values.
The following statement gives an example of creating a derived factor and then renaming the levels of the factor:
output out=new [A1 A2]=A cvals=('A' 'B' 'C' 'D');
This statement converts two two-level factors (A1 and A2) into one four-level factor (A), which has the levels A, B, C, and D.
Copyright © SAS Institute, Inc. All Rights Reserved.