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 27.036 206.943 2 18.250 212.915 3 21.033 202.583 4 29.261 211.161 5 20.353 236.943 6 18.254 216.064 7 26.494 204.622 8 18.732 211.095 9 30.877 218.177 10 18.276 203.793 11 10.875 201.891 12 17.625 200.383 13 14.991 209.506 14 23.694 210.016 15 24.621 224.116 16 26.266 189.962 17 20.870 215.364 18 23.162 212.991 19 26.849 219.352 20 28.869 212.911 21 22.388 215.019 22 27.518 238.305 23 23.129 241.800 24 20.034 232.937 25 27.383 232.227 26 22.344 231.380 27 24.324 232.432 28 24.309 216.651 29 27.043 230.453 30 28.024 226.647 31 30.151 235.176 32 36.999 231.627 > train; V1 V2 1 21.290 226.277 2 17.257 205.268 3 25.118 225.536 4 21.727 217.273 5 23.611 208.796 6 19.549 232.581 7 29.007 210.914 8 29.448 192.638 9 18.611 226.509 10 28.325 207.393 11 34.439 220.076 12 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] h m h m m h h m h h h m Levels: h m $posterior h m 1 0.6834882 0.31651178 2 0.1174884 0.88251164 3 0.7932429 0.20675712 4 0.4856996 0.51430038 5 0.3574948 0.64250517 6 0.7513166 0.24868335 7 0.6319089 0.36809113 8 0.2290048 0.77099515 9 0.5839335 0.41606650 10 0.5180961 0.48190394 11 0.9151472 0.08485277 12 0.4326275 0.56737249 $x LD1 1 -0.25791846 2 1.62494782 3 -0.64630363 4 0.30098226 5 0.65848583 6 -0.48483824 7 -0.10287521 8 1.08265214 9 0.03327255 10 0.21338107 11 -1.34476060 12 0.44554273 >