
Derive ROC-based biomarker cutoffs using adjusted risk
Source:R/derive_cutoffs_sensspec.R
derive_cutoffs_sensspec.RdImplements a ROC-guided two-cutoff approach to classify subjects into rule-out, rule-in, or indeterminate zones using confounder-adjusted risk scores.
Usage
derive_cutoffs_sensspec(
adjust_result,
biomarker,
outcome,
sens_target = 0.8,
spec_target = 0.8,
loess_span = 0.35
)Arguments
- adjust_result
Output list from
adjust_score(), containing the augmented dataset with biomarker, adjusted_risk, and outcome.- biomarker
Character, name of biomarker column.
- outcome
Character, name of binary disease outcome column (0/1). If missing, the outcome stored in
adjust_resultwill be used.- sens_target
Numeric, target sensitivity for rule-out threshold (default = 0.80).
- spec_target
Numeric, target specificity for rule-in threshold (default = 0.80).
- loess_span
Numeric, smoothing parameter for LOESS regression (default = 0.35). Smaller values give more flexibility, larger values give smoother fits.
Value
List with rule-out cutoff (c_L), rule-in cutoff (c_H),
classification vector, and augmented dataset.
Details
Method
Compute ROC curve with predictor =
adjusted_riskand outcome = true disease status.Identify thresholds:
Rule-out threshold (
T_L): lowest risk threshold with sensitivity\(\geq\)sens_target(default 0.80).Rule-in threshold (
T_H): highest risk threshold with specificity\(\geq\)spec_target(default 0.80).
Map thresholds back to biomarker scale by fitting a LOESS regression (
adjusted_risk~ biomarker, default span = 0.35 (user-adjustable via loess_span)) and interpolating biomarker values atT_LandT_H.Classification:
biomarker <
c_L= "Negative" (rule-out).biomarker >
c_H= "Positive" (rule-in).otherwise = "Indeterminate".
References
Giacomucci, G., Crucitti, C., Ingannato, A., et al. (2025). The two cut-offs approach for plasma p-tau217 in detecting Alzheimer's disease. Alzheimer's & Dementia: Diagnosis, Assessment & Disease Monitoring, 17:e70116.
Hazan, J., Liu, K.Y., Isaacs, J.D., Howard, R. (2025). Cut-points and gray zones: The challenges of integrating Alzheimer's disease plasma biomarkers into clinical practice. Alzheimer's & Dementia, 21:e70113.
Examples
n <- 500
set.seed(123)
# outcome
DISEASE <- rbinom(n, 1, 0.35)
# biomarker depends on disease
PTAU <- rnorm(n, mean = 25 + 10 * DISEASE, sd = 8)
# confounders (optional noise)
AGE <- round(rnorm(n, 73, 7))
SEX <- sample(c(0,1), n, replace = TRUE)
BMI <- rnorm(n, 25, 4)
HTN <- rbinom(n, 1, 0.3)
DM <- rbinom(n, 1, 0.2)
df <- data.frame(PTAU, AGE, SEX, BMI, HTN, DM, DISEASE)
res <- adjust_score(
df,
biomarker = "PTAU",
outcome = "DISEASE",
confounders = c("AGE","SEX","BMI","HTN","DM")
)
#> number of iterations= 704
#> Setting levels: control = 0, case = 1
#> Setting direction: controls < cases
cutoffs <- derive_cutoffs_sensspec(res, biomarker = "PTAU", outcome = "DISEASE")
#> Warning: Sensitivity target not achievable -> using 5th percentile of adjusted risk as fallback threshold.
#> Warning: Specificity target not achievable -> using 95th percentile of adjusted risk as fallback threshold.
cutoffs$c_L; cutoffs$c_H
#> [1] 9.467853
#> [1] 44.06341
table(cutoffs$class)
#>
#> Indeterminate Negative Positive
#> 461 13 26