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 27.036 206.943 2 0.000 18.250 212.915 3 0.369 21.033 202.583 4 1.207 29.261 211.161 5 0.000 20.353 236.943 6 0.000 18.254 216.064 7 0.000 26.494 204.622 8 0.720 18.732 211.095 9 0.000 30.877 218.177 10 0.000 18.276 203.793 11 0.000 10.875 201.891 12 0.000 17.625 200.383 13 0.000 14.991 209.506 14 0.000 23.694 210.016 15 3.788 24.621 224.116 16 1.876 26.266 189.962 17 4.885 20.870 215.364 18 1.511 23.162 212.991 19 2.026 26.849 219.352 20 2.406 28.869 212.911 21 3.265 22.388 215.019 22 3.853 27.518 238.305 23 2.523 23.129 241.800 24 2.377 20.034 232.937 25 1.580 27.383 232.227 26 4.965 22.344 231.380 27 4.955 24.324 232.432 28 2.127 24.309 216.651 29 1.764 27.043 230.453 30 2.458 28.024 226.647 31 3.015 30.151 235.176 32 5.068 36.999 231.627 > train; V1 V2 V3 1 0.000 21.290 226.277 2 0.908 17.257 205.268 3 0.000 25.118 225.536 4 0.000 21.727 217.273 5 0.000 23.611 208.796 6 1.003 19.549 232.581 7 0.000 29.007 210.914 8 0.000 29.448 192.638 9 0.000 18.611 226.509 10 0.000 28.325 207.393 11 0.000 34.439 220.076 12 0.000 22.757 213.391 > 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.016200260 0.9837997 2 0.044913089 0.9550869 3 0.025713080 0.9742869 4 0.011386106 0.9886139 5 0.009893828 0.9901062 6 0.226602807 0.7733972 7 0.021985389 0.9780146 8 0.010153246 0.9898468 9 0.011546940 0.9884531 10 0.017163463 0.9828365 11 0.065695869 0.9343041 12 0.010912923 0.9890871 $x LD1 1 1.6196367 2 1.2755260 3 1.4649528 4 1.7368788 5 1.7834428 6 0.6755735 7 1.5175670 8 1.7748691 9 1.7322256 10 1.6003753 11 1.1435949 12 1.7509554 >