Saving and Using Calibration Information |
When you specify METHOD=NORMAL to derive a linear or quadratic discriminant function, you can save the calibration information developed by the DISCRIM procedure in a SAS data set by using the OUTSTAT= option in the procedure. PROC DISCRIM then creates a specially structured SAS data set of TYPE=LINEAR, TYPE=QUAD, or TYPE=MIXED that contains the calibration information. For more information about these data sets, see Appendix A, Special SAS Data Sets. Calibration information cannot be saved when METHOD=NPAR, but you can classify a TESTDATA= data set in the same step. For an example of this, see Example 32.1.
To use this calibration information to classify observations in another data set, specify both of the following:
the name of the calibration data set after the DATA= option in the PROC DISCRIM statement
the name of the data set to be classified after the TESTDATA= option in the PROC DISCRIM statement
Here is an example:
data original; input position x1 x2; datalines; ...[data lines] ; proc discrim outstat=info; class position; run; data check; input position x1 x2; datalines; ...[second set of data lines] ; proc discrim data=info testdata=check testlist; class position; run;
The first DATA step creates the SAS data set Original, which the DISCRIM procedure uses to develop a classification criterion. Specifying OUTSTAT=INFO in the PROC DISCRIM statement causes the DISCRIM procedure to store the calibration information in a new data set called Info. The next DATA step creates the data set Check. The second PROC DISCRIM statement specifies DATA=INFO and TESTDATA=CHECK so that the classification criterion developed earlier is applied to the Check data set. Note that if the CLASS variable is not present in the TESTDATA= data set, the output will not include misclassification statistics.