R : Copyright 2003, The R Development Core Team Version 1.7.0 (2003-04-16) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type `license()' or `licence()' for distribution details. R is a collaborative project with many contributors. Type `contributors()' for more information. Type `demo()' for some demos, `help()' for on-line help, or `help.start()' for a HTML browser interface to help. Type `q()' to quit R. [Previously saved workspace restored] > library(MASS); > test <- read.table("madham.txt", sep=""); > train <- read.table("disputed.txt", sep=""); > cl <- factor(c(rep("m",14), rep("h",18))) > > test; V1 V2 V3 1 0.000 0.000 4.673 2 0.000 0.468 4.212 3 0.369 1.107 3.690 4 1.207 0.905 5.430 5 0.000 0.384 2.304 6 0.000 0.996 3.983 7 0.000 0.282 5.637 8 0.720 0.000 5.764 9 0.000 0.874 3.495 10 0.000 0.690 3.448 11 0.000 0.946 3.310 12 0.000 0.383 3.448 13 0.000 3.291 3.656 14 0.000 0.539 6.462 15 3.788 0.000 6.944 16 1.876 0.000 5.629 17 4.885 0.000 6.661 18 1.511 0.504 6.546 19 2.026 0.507 6.586 20 2.406 0.401 6.014 21 3.265 0.466 5.131 22 3.853 0.000 4.953 23 2.523 0.000 9.251 24 2.377 0.000 5.433 25 1.580 0.527 12.638 26 4.965 0.497 5.462 27 4.955 0.450 5.405 28 2.127 0.000 6.077 29 1.764 0.588 5.291 30 2.458 0.000 5.900 31 3.015 2.010 7.035 32 5.068 1.014 9.630 > train; V1 V2 V3 1 0.000 0.608 6.691 2 0.908 0.908 2.725 3 0.000 0.523 2.616 4 0.000 1.086 1.630 5 0.000 1.852 2.778 6 1.003 0.501 4.511 7 0.000 0.492 1.967 8 0.000 0.613 1.840 9 0.000 0.454 2.724 10 0.000 0.480 4.321 11 0.000 0.420 5.460 12 0.000 0.989 5.937 > cl; [1] m m m m m m m m m m m m m m h h h h h h h h h h h h h h h h h h Levels: h m > > z <- lda(test, cl); > > predict(z, train); $class [1] m m m m m m m m m m m m Levels: h m $posterior h m 1 0.0280564225 0.9719436 2 0.0071463529 0.9928536 3 0.0005867111 0.9994133 4 0.0001203234 0.9998797 5 0.0001593004 0.9998407 6 0.0799984515 0.9200015 7 0.0003217052 0.9996783 8 0.0002486923 0.9997513 9 0.0007035062 0.9992965 10 0.0032556476 0.9967444 11 0.0105279225 0.9894721 12 0.0089911327 0.9910089 $x LD1 1 1.322906 2 1.728609 3 2.460740 4 2.923671 5 2.841692 6 1.000800 7 2.636342 8 2.711556 9 2.407676 10 1.959406 11 1.614443 12 1.660988 >