Skip to contents

Enhanced ROC Analysis

Usage

timeroc(
  data,
  elapsedtime,
  outcome,
  outcomeLevel,
  marker,
  timepoints = "12, 36, 60",
  method = "incident",
  bootstrapCI = FALSE,
  nboot = 100,
  plotROC = TRUE,
  plotAUC = TRUE,
  timetypeoutput = "months",
  showOptimalCutoff = TRUE,
  showMarkerStats = TRUE,
  compareBaseline = FALSE,
  smoothAUC = FALSE,
  analysisType = "timedep",
  compareROCs = FALSE,
  markers,
  rocComparison = "delong",
  youdenIndex = TRUE
)

Arguments

data

.

elapsedtime

.

outcome

.

outcomeLevel

.

marker

.

timepoints

.

method

.

bootstrapCI

.

nboot

.

plotROC

.

plotAUC

.

timetypeoutput

Time units for display in plots and results.

showOptimalCutoff

Calculate and display optimal cutoff points that maximize Youden index.

showMarkerStats

Display descriptive statistics for the marker variable.

compareBaseline

Compare marker performance to a baseline model (AUC = 0.5).

smoothAUC

Apply smoothing to the AUC over time plot for better visualization.

analysisType

Choose between time-dependent ROC analysis or general binary classification ROC.

compareROCs

Compare multiple ROC curves using statistical tests (DeLong test for binary ROC).

markers

Additional marker variables to compare against the primary marker.

rocComparison

Statistical method for comparing ROC curves (binary analysis only).

youdenIndex

Calculate Youden index (sensitivity + specificity - 1) for optimal threshold selection.

Value

A results object containing:

results$texta html
results$aucTablea table
results$rocPlotan image
results$aucPlotan image
results$markerStatsa table
results$cutoffTablea table
results$modelComparisona html
results$clinicalInterpretationa html
results$binaryROCTablea table
results$rocComparisona table
results$binaryROCPlotan image
results$diagnosticPerformancea html

Tables can be converted to data frames with asDF or as.data.frame. For example:

results$aucTable$asDF

as.data.frame(results$aucTable)