Displaying 1 result from an estimated 1 matches for "likm".
Did you mean:
like
2011 Apr 12
0
cross-validation complex model AUC Nagelkerke R squared code
...t would be no problem
to calculate a Nagelkerke R squared measure and an AUC value (for
example with the pROC package) following the script:
BaseRate <- table(Data$Y[[1]])/sum(table(Data$Y))
L(0)=Likelihood(Null-Model)=
(BaseRate*log(BaseRate)+(1-BaseRate)*log(1-BaseRate))*sum(table(Data$Y))
LIKM <- predict(fit.glm, type="response")
L(M)=Likelihood(FittedModell)=sum(Data$Y*log(LIKM)+(1-Data$Y)*log(1-LIKM))
R2 = 1-(L(0)/L(M))^2/n
R2_max=1-(L(0))^2/n
R2_Nagelkerke=R2/R2max
library(pROC)
AUC <- auc(Data$Y,LIKM)
I checked this kind of caculation of R2_Nagelkerke and AUC-Value...