I am trying to perform a logistic regression by grouping I tried all the methods , that have been listed, yet i keep getting the following error
Error in UseMethod("predict") : no applicable method for 'predict' applied to an object of class "c('tbl_df', 'tbl', 'data.frame')"
# analysis ----------------------------------------------------------------
models<- df %>%
group_by(organ) %>%
do(model = glm(IHC ~ Dose,
data = .,
family = binomial(logit))) %>%
ungroup
new<-predict(models, newdata = data.frame(dose=1:10))
Error in UseMethod("predict") :
no applicable method for 'predict' applied to an object of class "c('tbl_df', 'tbl', 'data.frame')"
Organ_factor organ Dose IHC
1 1 Diaphragm 0.00 0
2 2 Diaphragm inflammation 0.00 0
3 3 Heart cell 0.00 0
4 5 Heart mixed cell 0.00 0