/* File "discrim2.sas": class example from slides 13-16. Note comments in SAS are enclosed by "slash-star" and "star-slash." First import the discrim.xls data as usual, then highlight the following code and select Run > Submit from the main menu. */ proc plot data=work.discrim; plot age*sal=expcat; run; /* The following code runs a canonical discriminant analysis. At this stage, the relevant output includes "raw canonical coefficients" ("Z" in the notes), the "classification results" (giving probabilities of being in each group), and the "classification summary"; ignore all the other output for now. */ proc discrim canonical list data=work.discrim out=work.results; class expcat; var age sal; priors proportional; id id; run; /* A plot of the two canonical discriminant functions provides some insight into what is going on. */ proc plot data=work.results; plot can2*can1=expcat; run; /* Since the second canonical discriminant function appears to add little extra discriminating power beyond that of the first canonical discriminant function, see if results change when using just the first function. */ proc discrim canonical list data=work.results out=work.results; class expcat; var can1; priors proportional; id id; run;