diff_cvAUC: diff_cvAUC

Description Usage Arguments Value Examples

View source: R/mainFunctions.R

Description

This function estimates the difference between two cross-validated AUCs fit using the wrap_cvAUC function. It also provides an influence function-based confidence interval estimate and hypothesis test of the null hypothesis that the two CV-AUCs are equal.

Usage

1
diff_cvAUC(fit1, fit2, confidence = 0.95)

Arguments

fit1

An object of class wrap_AUC

fit2

An object of class wrap_AUC

confidence

A numeric between 0 and 1 indicating the nominal coverage probability for the confidence interval.

Value

An object of class diff_cvAUC with the following entries:

diff

The difference in CV-AUC between the two fits.

ci

The confidence interval for the difference between the two fits.

p

The two-sided p-value for the test that the two CV-AUCs are equal.

folds

The number of folds used by fit1 and fit2.

learner1

The name of the learner used for fit1.

learner2

The name of the learner used for fit2.

confidence

The confidence interval level.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
n <- 1000
X <- data.frame(x1=rnorm(n),x2=rnorm(n))
Y <- rbinom(n,1,plogis(X$x1 + X$x2))
myglm1 <- function(Y,X,newX){
   fm <- glm(Y~.,data=X,family=binomial())
   pred <- predict(fm,newdata=newX,type="response")
   return(list(fit = fm, pred = pred))
}
myglm2 <- function(Y,X,newX){
  fm <- glm(Y~x1,data=X,family=binomial())
  pred <- predict(fm,newdata=newX,type="response")
  return(list(fit = fm, pred = pred))
}
out1 <- wrap_cvAUC(Y = Y, X=X, learner = "myglm1")
out2 <- wrap_cvAUC(Y = Y, X=X, learner = "myglm2")

diff_auc <- diff_cvAUC(fit1 = out1, fit2 = out2)

benkeser/cvAUC.plus documentation built on Feb. 1, 2021, 8:42 a.m.