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 1 206.943 95.794 2 212.915 113.243 3 202.583 88.930 4 211.161 88.386 5 236.943 76.805 6 216.064 91.271 7 204.622 104.284 8 211.095 97.983 9 218.177 91.756 10 203.793 121.724 11 201.891 90.780 12 200.383 101.533 13 209.506 85.558 14 210.016 97.469 15 224.116 100.379 16 189.962 96.623 17 215.364 116.341 18 212.991 98.187 19 219.352 100.304 20 212.911 109.864 21 215.019 106.343 22 238.305 97.964 23 241.800 93.776 24 232.937 100.170 25 232.227 114.797 26 231.380 110.725 27 232.432 85.135 28 216.651 94.196 29 230.453 85.832 30 226.647 92.429 31 235.176 109.548 32 231.627 96.300 > train; V1 V2 1 226.277 107.664 2 205.268 96.276 3 225.536 88.435 4 217.273 114.612 5 208.796 82.407 6 232.581 96.241 7 210.914 117.011 8 192.638 101.840 9 226.509 107.127 10 207.393 98.896 11 220.076 91.138 12 213.391 92.348 > 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] h m h h m h h m h m h m Levels: h m $posterior h m 1 0.8967995 0.1032005 2 0.1827444 0.8172556 3 0.6256962 0.3743038 4 0.8246339 0.1753661 5 0.1037051 0.8962949 6 0.8872417 0.1127583 7 0.7134061 0.2865939 8 0.0631667 0.9368333 9 0.8955841 0.1044159 10 0.2671380 0.7328620 11 0.5048856 0.4951144 12 0.3197294 0.6802706 $x LD1 1 -1.20283057 2 1.27770108 3 -0.08567565 4 -0.78663622 5 1.72423138 6 -1.13553985 7 -0.35554198 8 2.09021569 9 -1.19397672 10 0.94651020 11 0.24929868 12 0.77424579 >