On a regular dataset, the calls will go like this:
library(ROCR)
mymodelFit1 <- glm(data = myData, Outcome~ predictor1+
predictor2+ predictor3,
family = binomial(link = "logit")))
prob <- predict(mymodelFit1, newdata=myData, type="response")
pred <- prediction(prob, myData$Outcome)
perf <- performance(pred, measure = "tpr", x.measure = "fpr")
plot(perf)
auc <- performance(pred, measure = "auc")
auc <- auc@y.values[[1]]
auc
Now, I have used the mice package to impute missing data:
library(mice)
impData <- mice(analysis_set,m=5,maxit=50,meth='pmm',
seed=500, printFlag = FALSE)
And generated a logistic model using the imputed dataset:
mymodelFit2 <- with(data = impData, exp = glm(Outcome~ predictor1+
predictor2 + predictor3,
family = binomial(link = "logit")))
The question is: how can I calculate the AUC for the new model (mymodelFit2)?
"mice" generates x number of sets for missing values (5 in this case, specified in the m= parameter of mice()). The model has x number (5 in this case) of estimates.
Is there a function or an easy way to calculate AUC for these models? And how can I get an AUC for the pooled model?