using predict() and table() in r

前端 未结 1 1855
余生分开走
余生分开走 2020-12-11 13:35

I have used glm on the learning data set which without NAs has 49511 observations.

glmodel<-glm(RESULT ~ ., family=binomial,data         


        
相关标签:
1条回答
  • 2020-12-11 14:16

    You used the wrong parameter name in predict. It should be newdata=, not data=. So the reason you get 49511 elements is that the default for predict when you don't specify new data is to output the predicted values for the data you created the model with. Hence you're getting the predicted values for your original data.

    0 讨论(0)
提交回复
热议问题