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. > library(MASS); > test <- read.table("madham1.txt", sep=""); > train <- read.table("disputed1.txt", sep=""); > cl <- factor(c(rep("m",14), rep("h",18))) > > test; V1 V2 V3 1 0.000 206.943 194.927 2 0.000 212.915 194.665 3 0.369 202.583 190.775 4 1.207 211.161 195.173 5 0.000 236.943 206.221 6 0.000 216.064 202.788 7 0.000 204.622 200.676 8 0.720 211.095 198.127 9 0.000 218.177 193.999 10 0.000 203.793 201.034 11 0.000 201.891 213.712 12 0.000 200.383 206.130 13 0.000 209.506 221.207 14 0.000 210.016 189.553 15 3.788 224.116 196.338 16 1.876 189.962 197.467 17 4.885 215.364 174.067 18 1.511 212.991 176.234 19 2.026 219.352 176.292 20 2.406 212.911 182.438 21 3.265 215.019 173.041 22 3.853 238.305 179.417 23 2.523 241.800 183.768 24 2.377 232.937 186.078 25 1.580 232.227 183.254 26 4.965 231.380 189.176 27 4.955 232.432 192.793 28 2.127 216.651 200.851 29 1.764 230.453 201.646 30 2.458 226.647 201.082 31 3.015 235.176 187.940 32 5.068 231.627 180.943 > train; V1 V2 V3 1 0.000 226.277 203.163 2 0.908 205.268 181.653 3 0.000 225.536 182.627 4 0.000 217.273 183.053 5 0.000 208.796 198.148 6 1.003 232.581 184.962 7 0.000 210.914 184.366 8 0.000 192.638 196.933 9 0.000 226.509 207.898 10 0.000 207.393 187.710 11 0.000 220.076 186.476 12 0.000 213.391 194.591 > 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 h m m m m m m Levels: h m $posterior h m 1 0.010838072 0.9891619 2 0.278819688 0.7211803 3 0.088458456 0.9115415 4 0.055037047 0.9449630 5 0.007009260 0.9929907 6 0.617610818 0.3823892 7 0.034136047 0.9658640 8 0.003236111 0.9967639 9 0.006605178 0.9933948 10 0.019791247 0.9802088 11 0.044954650 0.9550454 12 0.013252700 0.9867473 $x LD1 1 1.7116022 2 0.5786277 3 1.0181119 4 1.1804321 5 1.8513998 6 0.1240530 7 1.3392534 8 2.0983298 9 1.8704080 10 1.5172550 11 1.2481427 12 1.6468756 >