options ls=78; title "Canonical Correlation Analysis - Sales Data"; data sales; infile "D:\Statistics\STAT 505\data\sales.csv" firstobs=2 delimiter=','; input growth profit new create mech abs math; run; /* The vprefix and wprefix options specify names to separate the two * sets of variables for the analysis. * The vname and wname options are more descriptive string names to be used * to describe the two sets of variables. * The var and with statements specify which variables go into each set. * They are referred to by the terms used in the vprefix and wprefix, respectively. */ proc cancorr data=sales out=canout vprefix=sales vname="Sales Variables" wprefix=scores wname="Test Scores"; var growth profit new; with create mech abs math; run; /* This plots the first canonical pair as a 2d scatterplot. * Other canonical pairs can also be plotted by changing * the variables used in the plot statement. */ proc gplot data=canout; axis1 length=3 in; axis2 length=4.5 in; plot sales1*scores1 / vaxis=axis1 haxis=axis2; symbol v=J f=special h=2 i=r color=black; run;