Skip to content
Prev 279779 / 398506 Next

lda output missing

That's odd. You don't provide a reproducible example, but using
a built-in dataset (from the help for lda) I get the Proportion of Trace
given by the print.lda method.

library(MASS)
Iris <- data.frame(rbind(iris3[,,1], iris3[,,2], iris3[,,3]), Sp =
rep(c("s","c","v"), rep(50,3)))
train <- sample(1:150, 75)
z <- lda(Sp ~ ., Iris, prior = c(1,1,1)/3, subset = train)
print(z)
Call:
lda(Sp ~ ., data = Iris, prior = c(1, 1, 1)/3, subset = train)

Prior probabilities of groups:
        c         s         v
0.3333333 0.3333333 0.3333333

Group means:
  Sepal.L. Sepal.W. Petal.L.  Petal.W.
c 5.947826 2.786957 4.326087 1.3652174
s 5.050000 3.380769 1.465385 0.2346154
v 6.811538 3.023077 5.700000 2.0653846

Coefficients of linear discriminants:
                LD1       LD2
Sepal.L. -1.6665885  1.104460
Sepal.W. -0.8681909  1.872188
Petal.L.  2.4670375 -1.499070
Petal.W.  4.2156275  2.948759

Proportion of trace:
   LD1    LD2
0.9916 0.0084

Here's my sessionInfo(). Are you certain everything is up-to-date?
What OS are you running? Do you have other packages loaded that could
be interfering? What happens when you run the example I used?
R version 2.14.0 (2011-10-31)
Platform: x86_64-redhat-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=C                 LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] MASS_7.3-16

loaded via a namespace (and not attached):
[1] tools_2.14.0
On Thu, Dec 8, 2011 at 10:29 AM, David Lutz <lutzda at wfu.edu> wrote: