%include data(cars2); *-- Find high-leverage points to label in plots 2 & 3; %outlier(data=cars2, var= weight year engine horse accel cylinder, id=case, print=no, pvalue=0.001, gplot=NO, out=carsout); *-- data set using weights to determine which points to label; data cars; set carsout; length col $8 label $3; if _weight_>0 then label='x '; else label=trim(left(put(case,3.0))); col = scan('blue red green', origin); *-- standard biplot: Dim 1 & 2; %biplot(data=cars, var=weight year engine horse accel cylinder, id=case, std=std, scale=.24, htext=0.8 1.8, m0=0, colors = (col) black, copy=col origin, out=biplot, anno=bianno, name=biplot31, adjvar = %str( if text='year' then position='B'; else if text='accel' then position='A'; else if text in ('weight', 'cylinder') then position='C'; else position='6'; ), adjobs = %str( if text='20' then size=1.4; ) ); %gskip; *-- collinearity biplot: last two dimensions; %biplot(data=cars, var=weight year engine horse accel cylinder, id=label, std=std, dim=6, plotreq=dim6*dim5, htext=0.8 1.8, m0=0, inc=0.1, xextra=1 0, colors = (col) black, copy=col origin, dimlab=Dimension, out=biplot, anno=bianno, name=biplot32, adjvar = %str( if text='horse' then position='6'; ), adjobs = %str( if text ^= 'x' then size=1.4; ) ); %gskip; *-- Condition index biplot: Dim 1 & 6, with data ellipse; %biplot(data=cars, var=weight year engine horse accel cylinder, id=case, std=std, dim=6, plotreq=dim6*dim1, htext=0.8 1.8, m0=0.1, gplot=no, colors = (col) black, copy=col origin, dimlab=Dimension, out=biplot, anno=bianno ); *-- Select just the observation scores; data biplobs; set biplot; where (_type_='OBS'); run; %ellipses(data=biplobs, x=dim1, y=dim6, vaxis=axis98, /* use AXIS statements generated by %biplot */ haxis=axis99, plot=no, /* suppress the plot */ out=ellipses /* output Annotate data set */ ); %biplot(data=cars, var=weight year engine horse accel cylinder, id=label, std=std, dim=6, plotreq=dim6*dim1, htext=0.8 1.8, m0=0.0, colors = (col) black, copy=col origin, dimlab=Dimension, out=biplot, anno=bianno, inanno=ellipses, name=biplot33, adjvar = %str( if text in ('horse','weight', 'engine', 'cylinder') then position='6'; else if text='accel' then position='4'; ), adjobs = %str( if text ^= 'x' then size=1.4; ) );