I wrote (in part) > > I am running a linear discriminant analysis as follows > > <<<< > discrim1 <- lda(normvar~ mafmahal+ mrfmahal+ mffmahal+ bafmahal+ brfmahal+ > cofmahal+ bmfmahal+ cfmahal+ fractmahal+ antmahal+ absmifmahal+ > absifmahal, subset = train) > prediction <- predict(discrim1, traintest1[-train,])$class > > When I do this, I get a warning message: > > <<< > Warning message: > 'newdata' had 795 rows but variable(s) found have 796 rows > > However, when I look at 'newdata' (i.e. traintest1) with dim, I find it has > 796 rows: > > <<< >> dim(traintest1) > [1] 796 612 >
Erik Iverson asked: What happens when you do dim(traintest1[-train,]) ------------ That also gives 796 rows, but 611 columns. So, I also tried: prediction <- predict(discrim1, traintest1, subset = (train == F))$class which also gave 796 rows.... even though, when I do table(train) it shows FALSE TRUE 396 400 Peter [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.