1

I have a question on plotting ROC curve for my model which has log of odds as the response. For example:

model<-lm((ln(y/1-y)~Temp+RH+DmaxT, data=fit) #'y' is a proportion

Predicted response was obtained for a new data set as:

Predicted_model<-predict(model, newdata, type = 'response')

Predicted values were back-transformed to get values in proportion

I have new observations in proportion and I used 0.05 cutoff value to represent control (<0.05) and cases (>0.05)

newdata$observed<-ifelse(newdata$observed > 0.05, "cases", "controls")

I plotted ROC curve using the following formula

roc(newdata$observed, predicted_model_backtrans, legacy.axes = TRUE, plot = TRUE, print.auc = TRUE)

With this formula, I got AUC value 1 and the plot is different than expected. I couldn't figure out what would be the best way to create ROC curve for my model type. Any help would be appreciated.

I also tried to create ROC curve where I changed observed and predicted proportion into binary characteristics (control (<0.05) and cases (>0.05)) which gave me straight line curve rather than smooth.

Rushabh Patel
  • 2,672
  • 13
  • 34
Bhim
  • 11
  • 2
  • Please post questions only once: https://stats.stackexchange.com/questions/404873/how-to-create-a-roc-curve-for-a-model-which-has-log-of-odds-as-response – Calimo Apr 25 '19 at 06:00
  • If you're asking how to do it programmatically, please post a minimal, complete and reproducible example. See https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example and https://stackoverflow.com/help/mcve – Calimo Apr 25 '19 at 06:02

0 Answers0