/* This is a subset of the pens data from the UCI archive (the same data used in the SAS course DMDT) X1-X16 are 16 pen positions for subjects writing on a pressure sensitive pad. Digit is the digit they were writing. */ data next; infile 'a:\minertalk\pens.txt'; input x1-x16 digit; nine=(digit=9); cards; proc print uniform noobs data=next(obs=800); run; proc princomp noprint out=digits; var x1-x16; proc print data=digits(obs=5); proc logistic; model nine=prin1-prin16/selection=backward; run; proc gplot; plot prin1*prin2=digit; symbol1 v="0" c=red i=none; symbol2 v="1" c=blue; symbol3 v="2" c=gray; symbol4 v="3" c=tan; symbol5 v="4" c=orange; symbol6 v="5" c=cyan; symbol7 v="6" c=black; symbol8 v="7" c=blue; symbol9 v="8" c=green; symbol10 v="9" c=purple; run; ************* Macro to plot sets of 3 digits *************; %macro plot3(p1, p2, pref, d1, d2, d3); proc gplot; plot &pref.&p1 * &pref.&p2=digit; where digit in (&d1 , &d2, &d3 ); symbol1 v="&d1" c=red i=none; symbol2 v="&d2" c=blue; symbol3 v="&d3" c=green; title h=1.5 j=left "&pref.&p1 by &pref.&p2 for digits &d1, &d2, &d3 "; %mend ; ****************************************************; ** Plot some triples: use (d1