Binomial GLM using caret
I would like to put Binomial GLM on a specific dataset. Using glm (..., family = binomial) everything works fine, but I would like to do it with the traint train () function. Unfortunately I am getting an unexpected error that I cannot get rid of.
library("marginalmodelplots")
library("caret")
MissUSA <- MissAmerica08[,c(2,4,6,7,8,10)]
formula<-cbind(Top10, 9-Top10)~.
glmfit <- glm(formula=formula,data=MissUSA,family=binomial())
trainfit<-train(form=formula,data=MissUSA,trControl=trainControl(method = "none"), method="glm", family=binomial())
The error I am getting is: "Error: nrow (x) == length (y) is not TRUE"
+3
source to share