OUTFILES | OUTFILE file-option <file-option …>;
where file-option represents one of the following:
OUTMODEL | OUTRAM= file-name [ MODEL= int-list < , int-list > ]
OUTSTAT= file-name [ GROUP= int-list < , int-list > ]
OUTWGT= file-name [ GROUP= int-list < , int-list > ]
with file-name representing an output file name and int-list representing list of model or group numbers
Use the OUTFILES statement when you need to output multiple-group or multiple-model information to output files in a complex way. In each OUTFILES statement, each possible file-option should appear no more than once. However, as needed, you can use the OUTFILES statement more than once. For example, suppose you want to create two OUTWGT= files for different sets of groups. You can specify the OUTFILES statement twice, as shown in the following specification:
outfiles outwgt=file1 [group=1,2]; outfiles outwgt=file2 [group=3,4];
In the first OUTFILES statement, the weights for groups 1 and 2 are output to the file file1
. In the second OUTFILES statement, the weights for groups 3 and 4 are output to the file file2
.
When the OUTMODEL= , OUTSTAT= , or OUTWGT= option is intended for all groups or models, you can simply specify the option in the PROC CALIS statement. Only when you need to output the group (model) information from more than one group (model), but not all groups (models), to a single output file does the use the OUTFILES statement become necessary. For example, consider the following specification:
proc calis method=gls; outfiles outmodel=outmodel [model=1,3] outwgt=outwgt [group=1,2] outstat=outstat [group=2,3]; group 1 / data=g1; group 2 / data=g2; group 3 / data=g3 outwgt=outwgt3; model 1 / group=1; factor N=3; model 2 / group=2; factor N=2; model 3 / group=3; factor N=3; run;
You fit three different factor models to three groups: Model 1 for Group 1, Model 2 for Group 2, and Model 3 for group 3.
In the OUTFILES statement, you output model information from models 1 and 3 to an output file named outmodel
, weight matrices from groups 1 and 2 to outwgt
, and statistics from groups 2 and 3 to outstat
. In each of these output files, you have information from more than one (but not all) groups or models. In the GROUP
statement for group 3, you have another OUTWGT=
file named outwgt3
for group 3 alone.
Note that you cannot specify the preceding output file organization by using the following statements:
proc calis method=gls; group 1 / data=g1 outwgt=outwgt; group 2 / data=g2 outwgt=outwgt outstat=outstat; group 3 / data=g3 outwgt=outwgt3 outstat=outstat; model 1 / group=1 outmodel=outmodel; factor N=3; model 2 / group=2; factor N=2; model 3 / group=3 outmodel=outmodel; factor N=3; run;
This specification will not work because SAS forbids the repeated specification of the same output file in the same PROC CALIS
run. That is, you cannot specify OUTWGT=outwgt
, OUTSTAT=outstat
, or OUTMODEL=outmodel
more than once in the PROC CALIS run without causing file invocation problems (however, multiple specification of the same
input file is not a problem).
If you specify any of the output files for a group (or a model) in both of the OUTFILES and the GROUP
(or MODEL
) statements, the destination specified in the more specific GROUP
(or MODEL
) statement will be used. For example, for the following specification PROC CALIS will save the Model 2 information in the
OUTMODEL=outmodel2
data set, but not in the OUTMODEL=outfile1
data set:
proc calis method=gls; outfiles outmodel=outfile1 [model=1,2]; group 1 / data=g1; group 2 / data=g2; model 1 / group=1; factor N=3; model 2 / group=2 outmodel=outmodel2; factor N=2; run;
The OUTFILES statement is intended for arranging output files in a complex way. The use of the OUTFILES statement is unnecessary in the following situations:
If you have a single-sample analysis, you do not need to use the GROUP statement. As a result, you can simply use the OUTSTAT= or OUTWGT= options in the PROC CALIS statement for specifying the output destinations. Therefore, the OUTFILES statement is not needed.
If you have a single model in your analysis, you do not need to use the MODEL statement. As a result, you can simply use the OUTMODEL= options in the PROC CALIS statement for specifying the output destination. Therefore, the OUTFILES statement is not needed.
If you have multiple groups or multiple models in your analysis and information for all groups or models is output to the same file, you do not need to use the OUTFILES statement. You can simply use the OUTSTAT= , OUTWGT= , or OUTMODEL= options in the PROC CALIS statement because the output file information is automatically propagated from the PROC CALIS statement to the groups or models.
If you have multiple groups or multiple models in your analysis and each group or model has a unique output data file destination (including cases where some groups or models might not have any output files), you do not need to use the OUTFILES statement. You can simply specify the OUTSTAT= , OUTWGT= , or OUTMODEL= options in the GROUP or MODEL statements.