options ps=85 ls=65;

title 'SAS discrim example 3';

 

data iris;

  infile 'D:\\T11-5.DAT';

  input SepalLength SepalWidth PetalLength PetalWidth Species;

run;

 

proc print data=iris;

      title2 'Output Discriminant Statistics';

run;

 

title2 "scatter plot of SL and SW";

%plotit(data=iris,labelvar=_blank_, symvar=species,

plotvars=SepalLength SepalWidth, color=black, colors=blue);

run;

 

proc plot data=iris;

  plot PetalLength*PetalWidth=species;

  *plot SepalLength*PetalLength=species;

  *plot PetalLength*SepalWidth=species;

  *plot SepalLength*PetalWidth=species;

  *plot SepalWidth*PetalWidth=species;

run;

 

proc discrim data=iris outstat=irisstat

                wcov pcov method=normal pool=test

                distance anova manova listerr crosslisterr;

      class Species;

      var SepalLength SepalWidth PetalLength PetalWidth;

      title2 'Using Quadratic Discriminant Function';

run;

 

proc print data=irisstat;

      title2 'Output Discriminant Statistics';

run;