CompareStratAUCs: Inference on the Area Under the Cumulative Count Curve

View source: R/Stratified.R

CompareStratAUCsR Documentation

Inference on the Area Under the Cumulative Count Curve

Description

Confidence intervals and p-values for the difference and ratio of areas under the mean cumulative count curves, comparing treatment (arm = 1) with reference (arm = 0).

Usage

CompareStratAUCs(
  data,
  tau,
  alpha = 0.05,
  boot = FALSE,
  perm = FALSE,
  reps = 2000
)

Arguments

data

Formatted data.frame. FormatData.

tau

Truncation time.

alpha

Alpha level.

boot

Logical, construct bootstrap confidence intervals?

perm

Logical, perform permutation test?

reps

Replicates for bootstrap/permutation inference.

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.
n <- 100
covariates <- data.frame(
  arm = c(rep(1, n/2), rep(0, n/2)),
  strata = stats::rbinom(n, 1, 0.2)
)
data <- GenData(
  beta_event = c(log(0.5), log(0.8)),
  covariates = covariates
)

aucs <- CompareAUCs(
  data,
  strata = data$strata,
  tau = 2,
  boot = TRUE,
  perm = TRUE,
  reps = 25,
  alpha = 0.05
)
show(aucs)


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