Demonstration of the command "descr" of S-Plus for discrimination and classification. ** Data set: Table 11.1 of the textbook (Riding-mower owners) > dim(T11.1) % Data was loaded before. [1] 24 3 > T11.1[1,] income lot grp 1 60 18.4 1 > x=T11.1[,1:2] > plot(x[,1],x[,2],xlab='Income',ylab='lotsize') > text(x[,1],x[,2],T11.1[,3]) > m1=discr(x,2) > m1 $cor: [1] 7.338967e-001 3.020311e-007 $vars: [,1] [,2] [1,] 0.04953562 0.03870816 [2,] 0.38805246 -0.32448712 $groups: [,1] [,2] [1,] 0.7071066 0.7071070 [2,] -0.7071070 0.7071066 > y=as.matrix(x)%*%m1$vars % Obtain the discriminant variables > plot(y[,1],y[,2],xlab='first var',ylab='second var') > text(y[,1],y[,2],T11.1[,3]) *** Iris Data set Exercise 11.28, Table 11.5 > dim(T11.5) [1] 150 5 > y1=T11.5[,1]/T11.5[,2] > y2=T11.5[,3]/T11.5[,4] > y=cbind(log(y1),log(y2)) > plot(y[,1],y[,2],xlab='sepal',ylab='petal') > text(y[,1],y[,2],T11.5[,5]) > m2=discr(y,3) > m2 $cor: [1] 0.9397170 0.1202879 0.0000000 $vars: [,1] [,2] [1,] 8.872250 -5.820336 [2,] -2.927041 -2.993714 $groups: [,1] [,2] [,3] [1,] -0.8114433 0.09069956 0.5773504 [2,] 0.3271736 -0.74808037 0.5773503 [3,] 0.4842699 0.65738076 0.5773501 > z=y%*%m2$vars > plot(z[,1],z[,2],xlab='first var',ylab='second var') > text(z[,1],z[,2],T11.5[,5]) >