0
votes

Hello am trying to fit logistic model but am getting these error

fit.mis<-glm(Probation ~ Times_UP+Library+Activity,family=binomial,mar)

Error in as.data.frame.default(data) : 
cannot coerce class ‘"mads"’ to a data.frame

am not very expert in r .. does any body can help

1
Looks like mar is a class of mads, and is an output from mice package? glm requires input as dataframe, so it is failing to convert.zx8754
mar is an output of ampute() in mice packageM.Salim
i have try to convertM.Salim
mar<- as.data.frame(mar) ... but still i got the same errorM.Salim

1 Answers

1
votes

If you want to use the amputed data (result of ampute) to fit a model you can extract this with

mar$amp

in your example

fit.mis<-glm(Probation ~ Times_UP+Library+Activity,family=binomial,mar$amp)

more info can be found here