Chapter Contents |
Previous |
Next |
The PLAN Procedure |
proc plan seed=12345; factors a=3 b=2; run;
The plan as displayed by PROC PLAN is shown in Figure 50.5.
|
The first cell of the plan has a=2 and b=2, the second a=2 and b=1, the third a=1 and b=1, and so on. If you output the plan to a data set with the OUTPUT statement, by default the output data set contains a numeric variable with that factor's name; the values of this numeric variable are the numbers of the successive levels selected for the factor in the plan. For example, the following statements produce Figure 50.6.
proc plan seed=12345; factors a=3 b=2; output out=out; proc print data=out; run;
|
Alternatively, you can specify the values that are output for a factor with the CVALS= or NVALS= option. Also, you can specify that the internal values be associated with the output values in a random order with the RANDOM option. See the "OUTPUT Statement" section.
If you also specify an input data set (DATA=), each factor is associated with a variable in the DATA= data set. This occurs either implicitly by the factor and variable having the same name or explicitly as described in the specifications for the OUTPUT statement. In this case, the values of the variables corresponding to the factors are first read and then interpreted as describing the position of a cell in the plan. Then the respective values taken by the factors at that position are assigned to the variables in the OUT= data set. For example, consider the data set defined by the following statements.
data in; input a b; datalines; 1 1 2 1 3 1 ;
Suppose you specify this data set as an input data set for the OUTPUT statement.
proc plan seed=12345; factors a=3 b=2; output out=out data=in; proc print data=out; run;
PROC PLAN interprets the first observation as referring to the cell in the first row and column of the plan, since a=1 and b=1; likewise, the second observation is interpreted as the cell in the second row and first column, and the third observation as the cell in the third row and first column. In the output data set a and b have the values they have in the plan at these positions, as shown in Figure 50.7.
|
When the factors are random, this has the effect of randomizing the input data set in the same manner as the plan produced (see the "Randomizing Designs" section and the "Randomly Assigning Subjects to Treatments" section).
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.