Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Details of the FACTEX Procedure

OUTPUT Statement

OUTPUT OUT= SAS-data-set <options> ;
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:

OUT=SAS-data-set
gives the name of the output data set in which the design is saved. Note that OUT= is required.

options
You can use the options to
  • 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:

Recode Design Factors

By default, the output data set contains a variable for each factor in the design coded with standard values, as follows:

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 -1, 0, and +1 to the actual levels. Suppose the factors are pressure (PRESSURE) with character levels, agitation rate (RATE) with numeric levels, and temperature (TEMP) 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    )
                     temp     cvals=(100   150      200   );


The general form of options to recode factors is as follows:
factor-name NVALS= (level1 level2 ... levelq)
or

factor-name CVALS= ('level1' 'level2' ... 'levelq')
where
factor-name
gives the name of the design factor.
NVALS=
lists new numeric levels for design factors.
CVALS=
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" .

Recode Block Factor

If the design uses blocking, the output data set automatically contains a block variable named BLOCK, and for a design with b blocks, the default values of the block variable are 1, 2, ... b. 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:
BLOCKNAME= block-name <NVALS= (level1 level2 ... levelb)>
or

BLOCKNAME= block-name <CVALS= ('level1' 'level2' ... 'levelb')>
where
block-name
gives a new name for the block factor.
NVALS=
lists new numeric levels for the block factor. For details, see "Recode Design Factors" .
CVALS=
lists new character levels for the block factor. For details, see "Recode Design Factors" .

Note that you can simply rename the block variable using only the BLOCKNAME= option, without using the NVALS= and CVALS= options.

Replicate Entire Design

DESIGNREP=c
DESIGNREP=SAS-data-set
replicates the entire design. Specify DESIGNREP=c to replicate the design c times, where c 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 B \otimes A, where \otimes denotes the direct product.

For details, see "Replication" . For illustrations of the difference between the DESIGNREP= and POINTREP= options, see Example 15.6 and Example 15.7.

Replicate Design Point

POINTREP=p
POINTREP=SAS-data-set
replicates each point of the design. Specify POINTREP=p to replicate each design point p times, where p 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 \otimes B, where \otimes denotes the direct product.

For details, see "Replication" . For illustrations of the difference between the DESIGNREP= and POINTREP= options, see Example 15.6 and Example 15.7.

Randomize Design

RANDOMIZE <(u)>   < NOVALRAN >
randomizes the design. See "Randomization" for details. The following options are available:

(u)
specifies a number u to start the pseudo-random number generator. The value of u must be enclosed in parentheses immediately after the keyword RANDOMIZE, and it can be any positive integer up to 231-1. The default value of u is generated from the time of day.

NOVALRAN
prevents the randomization of theoretical factor levels to actual levels. The randomization of run order is still performed.

Create Derived Factors

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 k design factors, each with q levels, the derived factor has qk levels. Derived factors are useful when you create mixed-level designs; see Example 15.8 for an example. See "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

[ design-factors]= derived-factor < NVALS= (list-of-numbers)>
or

[ design-factors]= derived-factor < CVALS= ('string1' 'string2' ... 'stringn')>
where
design-factors
gives names of factors currently in the design. These factors are combined to create the new derived factor.
derived-factor
gives a name to the new derived factor. This name must not be used in the design.
NVALS=
lists new numeric levels for the derived factor.
CVALS=
lists new character levels for the derived factor. See "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 0,1, ... ,qk-1, where the derived factor is created from k design factors, each with q levels. In general, the CVALS= or NVALS= list for a derived factor must contain qk 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.

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.