Dear R-helper, I would like to compare the AUC of two logistic regression models (same population). Is it possible with R ? Thank you Roman Rouzier [[alternative HTML version deleted]]
What's AUC? If you mean AIC (Akaike Information Criterion), and if you fit logistic regression using "glm", the help file says that glm returns an object of class "glm", which is a list containing among other things an attribute aic. For example, suppose you fit a model as follows: fit <- glm(y~x, famil=binomial()...) Then fit$aic returns the AIC. You may also wish to consider anova and anova.glm. hope this helps. spencer graves rrouzier at mdanderson.org wrote:>Dear R-helper, > >I would like to compare the AUC of two logistic regression models (same >population). Is it possible with R ? > >Thank you > >Roman Rouzier > [[alternative HTML version deleted]] > >______________________________________________ >R-help at stat.math.ethz.ch mailing list >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html > >-- Spencer Graves, PhD, Senior Development Engineer O: (408)938-4420; mobile: (408)655-4567
Bernardo Rangel Tura
2004-Dec-15 20:30 UTC
[R] AUC for logistic regression [was: (no subject)]
At 17:07 15/12/2004, Spencer Graves wrote:>>Dear R-helper, >> >>I would like to compare the AUC of two logistic regression models (same >>population). Is it possible with R ? >> >>Thank you >> >>Roman RouzierRoman If I understand your question You have 2 ROC curve from same dataset. In this case you can use a routine create for me : seROC<-function(AUC,na,nn){ a<-AUC q1<-a/(2-a) q2<-(2*a^2)/(1+a) se<-sqrt((a*(1-a)+(na-1)*(q1-a^2)+(nn-1)*(q2-a^2))/(nn*na)) se } cROC<-function(AUC1,na1,nn1,AUC2,na2,nn2,r){ se1<-seROC(AUC1,na1,nn1) se2<-seROC(AUC2,na2,nn2) sed<-sqrt(se1^2+se2^2-2*r*se1*se2) zad<-(AUC1-AUC2)/sed p<-dnorm(zad) a<-list(zad,p) a } The first function (seROC) calculate teh standart error of ROC curve, the second function (cROC) compare ROC curves . The parameters: AUC - area under curve na - number of positives results nn - number total tests (positives +negatives) r - correlation of two numeric variables Best wishes Bernardo Rangel Tura, MD, MSc National Institute of Cardiology Laranjeiras Rio de Janeiro Brazil -- No virus found in this outgoing message. Checked by AVG Anti-Virus.
Bernardo Rangel Tura
2004-Dec-16 09:00 UTC
[R] AUC for logistic regression [was: (no subject)]
At 20:21 15/12/2004, Kerry Bush wrote:>Your formula is only a trapzoidal approximation to the >theoretical AUC. It might be downward biased. I am >also wondering if there is a funcion in R that can >compute the MLE estimate for AUC.Kerry I agree with you. But I dont Know compute the MLE estimate for AUC and its standatr error. Second I dont know MLE(AUC)/SE is normal so I dont konw wich test use. Third I dont konw compute the correction is necessary because the test in same population. If You explain me this topics I upgrade the funciotn with pleasure. But same with a possible downward bias the function solve Roman problem... Thanks in advance Bernardo Rangel Tura, MD, MSc National Institute of Cardiology Laranjeiras Rio de Janeiro Brazil -- No virus found in this outgoing message. Checked by AVG Anti-Virus.
Possibly Parallel Threads
- How to compare areas under ROC curves calculated with ROCR package
- About Mcneil Hanley test for a portion of AUC!
- How to compare areas under ROC curves calculated with ROC R package
- need help explain the routine input parameters for seROC and cROC found in the R archive
- ROCR: auc and logarithm plot