You use the function "predict" for that. You give a data frame with
the new observations, and make sure the variables have exactly the
same name.
# run example
library(MASS)
Class <- as.factor(rep(c("A","B","C"),each=30))
X1 <- c(rnorm(30),rnorm(30,3,2),rnorm(30,-3,1))
X2 <- c(rnorm(30,5,3),rnorm
Sir,
I am working with multiclass discriminant analysis.(say response variable
has 3classes).In R, using lda(), I get 2 sets of coefficients for the
discriminant function.Now, I want to put a new x-vector(vector of
independent variables) and want to check it corresponds to which class of
y.Is there
2 matches
Mail list logo