Displaying 1 result from an estimated 1 matches for "r2_nagelkerk".
Did you mean:
r2_nagelkerke
2011 Apr 12
0
cross-validation complex model AUC Nagelkerke R squared code
...]])/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 with
the built-in calculation in package "Design" and got consistent results.
Now I implement a cross validation procedure, dividing the sample
randomly into k-subsampl...