Learn R Programming

emplikAUC (version 0.5)

eltest4diff2auc: Testing the Difference of 2 AUC values, Paired Data, by Empirical likelihood.

Description

This function computes the two sample Log Empirical Likelihood ratio for testing \(H_0\): AUC1-AUC2 = theta. The two samples of paired data are in the x-matrix(mx2) and y-matrix(nx2).

Usage

eltest4diff2auc(theta, x, y, ind, tol.u, tol.v, tol.H0)

Value

A list containing

lambda

The final tilting parameter.

u

the new u vector.

v

The new v vector.

"-2LLR"

The -2 log empirical likelihood ratio.

Pval

The p-value.

Maxiter

The iteration number used in computing.

Arguments

theta

The "true" value of the AUC under \(H_0\), to be tested.

x

a matrix of observations, dim mx2, for the first sample. The test-results of biomarker 1 and 2 on healthy subjects

y

a matrix of observations, dim nx2, for the second sample. The test-results of biomarker 1 and 2 on desease subjects.

ind

A (smoothed) indicator function, to generate a Matrix of (smoothed) indicator values: I[x[i] < y[j]].

tol.u

Error tol for final u probability vector. Must > 0.

tol.v

Error tol for final v probability vector. Must > 0.

tol.H0

The error bound for the constrained NPMLE to satisfy \(H_0\), must >0.

Author

Mai Zhou <maizhou@gmail.com>.

Details

This function is similar to el2test4auc, but for the difference of 2 AUCs. Using our own algorithm (not EM). We listed 3 kind of tol to control convergence.

The empirical likelihood we used here is defined as $$ EL = \prod_{i=1}^m v_i \prod_{j=1}^n \nu_j ~;~~~~~~ \sum v_i =1 ~,~~ \sum \nu_j =1 ~. $$

References

Zhao, Y., Ding, X. and Zhou (2021). Confidence Intervals of AUC and pAUC by Empirical Likelihood. Tech Report. https://www.ms.uky.edu/~mai/research/eAUC1.pdf

Examples

Run this code
y <- c(10, 209, 273, 279, 324, 391, 566, 785)
x <- c(21, 38, 39, 51, 77, 185, 240, 289, 524)
#### We know the AUC estimator here is 0.75.
#### We may test a hypothesis about the AUC value: H0: AUC= 0.7
eltest4aucONE(theta=0.7, x=x, y=y, ind=smooth3, tol.u=1e-6, tol.v=1e-6, tol.H0=1e-6)
#### Two of the outputs should be '-2LLR'=0.1379561 and Pval=0.7103214

Run the code above in your browser using DataLab