/* Lesson 26-1 */ /* File Name = les2601.sas 12/19/02 */ options linesize=72; /* pagesize=20; */ proc format; value specname 1='Sentosa ' 2='Versicolor' 3='Virginica '; value specchar 1='S' 2='O' 3='V'; run; data iris; title "Fisher's Iris Data"; infile 'IRISES.DAT'; do obs=1 to 50; do species=1 to 3; input sepallen sepalwid petallen petalwid @@; format species specname.; output; end; end; /* label sepallen='Sepal Length in mm.' sepalwid='Sepal Width in mm.' petallen='Petal Length in mm.' petalwid='Petal Width in mm.'; */ proc print data=iris(obs=10); run; title2 'Correlation of this data'; proc corr data=iris; var sepallen sepalwid petallen petalwid; run; proc sort data=iris; by species; run; proc corr data=iris; var sepallen sepalwid petallen petalwid; by species; run; title2 'Histogram of petalwid'; proc chart data=iris; hbar petalwid/subgroup=species midpoints=0.0 to 3.0 by 0.1; format species specchar.; run; title2 'Discriminant Analysis'; proc discrim data=iris; class species; var petalwid; run; proc discrim data=iris outstat=irisout method=normal pool=test wcov pcov distance anova manova listerr crosslisterr; class species; var sepallen sepalwid petallen petalwid; run; proc print data=irisout; run;