auc: Extracts auc (se) and ROC curve estimates

Description Usage Arguments Details Value Author(s) References Examples

View source: R/AUCfunctions.R

Description

This function extracts auc (se) and ROC curve estimates from PHroc and PrevHroc model fits

Usage

1
auc(x1 = 20, x2 = NULL, fit, model = "PH", ROC = FALSE, ngrid = 100)

Arguments

x1

a value of covariate x1 at which to estimate auc and ROC curve. Can be absent.

x2

a value of covariate x2 at which to estimate auc and ROC curve. Can be absent.

fit

a coxph/croc object of model fit.

model

a character string specifying the model for the conave ROC curve, one of PH and PrevH. Default PH.

ROC

logical, if TRUE, ROC estimates are produced in addition to AUC. Default is FALSE.

ngrid

number of equal-spaced FPR values on unit interval to compute TRP. Dafault 100.

Details

The proportional hazards ROC (PHroc) model assumes proportional hazards between healthy and diseased populations: h(y|d=1,x)/h(y|d=0,x) = θ and produces ROC curve TPR = FPR^θ and AUC 1/(1+θ). With covariate, PHroc model takes the form of h(y) = h_0(y) exp(b1 d + b2 x + b3 d*x) where y, d, and x are score, status, and covariate, respectively, implying h(y|d=1,x)/h(y|d=0,x) = exp(b1 + b3 x). For binary x, θ = exp(b1) and exp(b1+b3) at x = 0 and x = 1, respectively. The proportional reversed hazards ROC (PrevHroc) assumes proportional reversed hazards instead, produces ROC curve TPR = 1-(1-FPR)^{1/θ}, and shares the same AUC 1/(1+θ). With λ(y) as the reversed hazard function, PrevHroc model takes the form of λ(y) = λ_0(y) exp(b1 d + b2 x + b3 d*x), implying λ(y|d=1,x)/λ(y|d=0,x) = exp(b1 + b3 x). Same as in PHroc, θ = exp(b1) and exp(b1+b3) at x = 0 and x = 1.

Delta method is used to derive s.e. of auc.

Value

either a vector of auc estimates or (if ROC = TRUE) a list of a vector of auc estimates and dataframe of FPR and TPR.

Author(s)

Zhen Chen (zhen.chen@nih.gov)

References

#' @export

Examples

1
2
auc(fit,"PH")
auc(x1=1,x2=.6,fit,"PrevH",ROC=TRUE)

liffuchen/cROC documentation built on May 14, 2020, 9:08 p.m.