SingleArmAUC: Single Arm Area Under the Cumulative Count Curve

View source: R/Main.R

SingleArmAUCR Documentation

Single Arm Area Under the Cumulative Count Curve

Description

Single Arm Area Under the Cumulative Count Curve

Usage

SingleArmAUC(
  data,
  alpha = 0.05,
  boot = FALSE,
  cens_after_last = TRUE,
  idx_name = "idx",
  reps = 2000,
  status_name = "status",
  strata = NULL,
  tau = NULL,
  time_name = "time",
  weights = NULL
)

Arguments

data

Data.frame.

alpha

Type I error level.

boot

Logical, construct bootstrap confidence intervals (slow)?

cens_after_last

Should subjects who lack an explicit censoring time be censored after their last observed event?

idx_name

Name of column containing a unique subject index.

reps

Number of replicates for bootstrap inference.

status_name

Name of column containing the status. Must be coded as 0 for censoring, 1 for event, 2 for death. Each subject should have an observation-terminating event, either censoring or death.

strata

Optional stratification factor.

tau

Numeric truncation time.

time_name

Name of column containing the observation time.

weights

Optional column of weights, controlling the size of the jump in the cumulative count curve at times with status == 1.

Value

Object of class compAUCs with these slots:

  • '@Areas': The AUC for each arm.

  • '@CIs': Observed difference and ratio in areas with confidence intervals.

  • '@Curves': Mean cumulative count curve for each arm; averaged across strata if present.

  • '@Pvals': Bootstrap and permutation p-values.

  • '@Reps': Bootstrap and permutation realizations of the test statistics.

  • '@Weights': Per-stratum weights and AUCs.

Examples

# Simulate data set.
covar <- data.frame(strata = rep(c(1, 2), each = 50))
data <- GenData(beta_event = log(0.5), covariates = covar)
# Calculate AUC.
auc <- SingleArmAUC(data, strata = data$strata, tau = 2)
auc <- SingleArmAUC(data, boot = TRUE, reps = 100, strata = data$strata, tau = 2)
show(auc)

zrmacc/MCC documentation built on July 16, 2025, 4:04 p.m.