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 1 0.000 2.003 2 0.000 0.000 3 0.369 0.738 4 1.207 0.905 5 0.000 0.000 6 0.000 1.328 7 0.000 0.282 8 0.720 1.081 9 0.000 0.583 10 0.000 1.379 11 0.000 1.418 12 0.000 0.000 13 0.000 1.097 14 0.000 1.077 15 3.788 1.263 16 1.876 3.752 17 4.885 3.996 18 1.511 1.007 19 2.026 1.520 20 2.406 3.208 21 3.265 4.198 22 3.853 3.302 23 2.523 3.364 24 2.377 6.452 25 1.580 3.686 26 4.965 2.483 27 4.955 2.252 28 2.127 4.558 29 1.764 1.764 30 2.458 4.425 31 3.015 4.020 32 5.068 1.521 > train; V1 V2 1 0.000 1.217 2 0.908 0.000 3 0.000 2.093 4 0.000 0.000 5 0.000 0.926 6 1.003 0.501 7 0.000 2.458 8 0.000 2.454 9 0.000 1.816 10 0.000 0.960 11 0.000 0.000 12 0.000 2.639 > 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 1.115712e-03 0.9988843 2 1.684660e-03 0.9983153 3 7.384781e-03 0.9926152 4 8.015139e-05 0.9999198 5 5.945823e-04 0.9994054 6 6.818825e-03 0.9931812 7 1.612976e-02 0.9838702 8 1.599292e-02 0.9840071 9 4.068002e-03 0.9959320 10 6.399637e-04 0.9993600 11 8.015139e-05 0.9999198 12 2.368303e-02 0.9763170 $x LD1 1 2.084146 2 1.976108 3 1.587675 4 2.773878 5 2.249070 6 1.608701 7 1.380812 8 1.383079 9 1.744664 10 2.229800 11 2.773878 12 1.278231 >