I want to predict the probability in glm ,but the console reported that unexpected symbol in AA which could not be find. How can I solve it?
this is my code.
model2 <- glm(survived ~age+sibsp+parch+pclass+embarked+fare+sex,family=binomial(link='logit'),data=mdata)
summary(model2)
head(predict(model2, type = "link"))
#predict probability
head(predict(model2, type = "response"))
AA <- data.frame(sibsp = 2,age =21,parch =2,pclass = 1,embarked ="c", fare = 26.55 sex ="female"))
predict(model2,type = "response",newdata = AA)
predict