Dear R users,
I have the following problem. Suppose I have the following toy data
set:> data
m1 m2 m3 m4 m5 state
[1,] 1 0 1 13 23 2
[2,] 0 1 0 23 94 2
[3,] 1 0 0 45 56 1
[4,] 0 1 0 35 84 2
[5,] 1 1 0 98 37 1
[6,] 1 1 0 68 1 2
where the last column is a categorical variable representing the outcome,
columns m1 to m3 are binary and columns m4 and m5 are continuous. I wish to
perform lda and then plot the results so I do:
sc.dat<-scale(data[,-6])
sc.dat<-cbind(sc.dat,data[,6])
try<-lda(sc.dat[,1:5],sc..dat[,6])
tr.pred<-predict(try)
eqscplot(tr.pred$x)
and then I get the following error (I also have collinearity which I ignore
because it doesnt matter):
> eqscplot(tr.pred$x)
Error in eqscplot(tr.pred$x) : subscript out of bounds
Why am I getting this error? What does it mean?
Any insight is highly appreciated.
Thanks in advance,
Pierre
[[alternative HTML version deleted]]