Hi,
What does this mean when I have something like:
qda.boot <- boot(train, qda.bootstrap, R = 500)
Error in qda.default(structure(data.matrix(x), class = "matrix"), ...) :
Rank deficiency in group M
with my qda.bootstrap() looks something like:
qda.bootstrap <- function(data, index) {
+ boot.qda <- qda(x = data[index, 2:9], group = data[index, 1])
+ qda.pred <- predict(boot.qda)
+ boot.resub <- sum(qda.pred$class != data[, 1]) / nrow(data)
+ data.pred <- predict(boot.qda, data[, 2:9])
+ data.resub <- sum(data.pred$class != data[,1]) / nrow(data)
+ abs(data.resub - boot.resub)
+ }
If I run qda.boot <- boot(train, qda.bootstrap, R = 500) a couple of
times, it sometimes work but other times just give me the error message
above. Is there a way to solve this?