Type: Package
Title: Treatment Effect Inference for Terminal and Non-Terminal Events under Competing Risks
Version: 1.0.2
Author: Daewoo Pak [aut, cre], Song Yang [aut]
Maintainer: Daewoo Pak <dpak@yonsei.ac.kr>
Description: Provides several confidence interval and testing procedures, based on either semiparametric (using event-specific win ratios) or nonparametric measures, including the ratio of integrated cumulative hazard (RICH) and the ratio of integrated transformed cumulative hazard (RITCH), for treatment effect inference with terminal and non-terminal events under competing risks. The semiparametric results were developed in Yang et al. (2022 <doi:10.1002/sim.9266>), and the nonparametric results were developed in Yang (2025 <doi:10.1002/sim.70205>). For comparison, results for the win ratio (Finkelstein and Schoenfeld 1999 <doi:10.1002/(SICI)1097-0258(19990615)18:11%3C1341::AID-SIM129%3E3.0.CO;2-7>), Pocock et al. 2012 <doi:10.1093/eurheartj/ehr352>, and Bebu and Lachin 2016 <doi:10.1093/biostatistics/kxv032>) are included. The package also supports univariate survival analysis with a single event. In this package, effect size estimates and confidence intervals are obtained for each event type, and several testing procedures are implemented for the global null hypothesis of no treatment effect on either terminal or non-terminal events. Furthermore, a test of proportional hazards assumptions, under which the event-specific win ratios converge to hazard ratios, and a test of equal hazard ratios, are provided. For summarizing the treatment effect across all events, confidence intervals for linear combinations of the event-specific win ratios, RICH, or RITCH are available using pre-determined or data-driven weights. Asymptotic properties of these inference procedures are discussed in Yang et al. (2022 <doi:10.1002/sim.9266>) and Yang (2025 <doi:10.1002/sim.70205>).
License: GPL (≥ 3)
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.3.3
NeedsCompilation: no
Packaged: 2026-01-08 01:06:24 UTC; dpak
Repository: CRAN
Date/Publication: 2026-01-09 18:00:02 UTC

Inference for Treatment Effects on Terminal and Non-Terminal Events under Competing Risks

Description

This package implements procedures for treatment effect inference on a terminal event and a non-terminal event. It estimates the effect size using either event-specific win ratios, RICH or RITCH, and the corresponding confidence intervals are provided. For easy comparison, results for the win ratio (Finkelstein and Schoenfeld 1999, Pocock et al. 2012; Bebu and Lachin 2016) are also included. Moreover, testing procedures are provided for the global null hypothesis of no treatment effect on either event. Additionally, it offers confidence intervals for linear combinations of the effect size estimates using fixed or data-driven weights. Finite-sample correction and transformations are used to improve type I error control in moderate samples. For further details, see Yang and Troendle (2021), Yang et al. (2022), and Yang (2025).

Details

Package: TxEffectsSurvival
Type: Package
Version: 0.0.1
License: GPL (>= 3)

Value

No return value, called for side effects.

Author(s)

Daewoo Pak and Song Yang \ Maintainer: Daewoo Pak dpak@yonsei.ac.kr

References

Yang, S. (2025). Testing and Estimation of Treatment Effects in Clinical Trials for Terminal and Non-Terminal Events Subject to Competing Risks. Statistics in Medicine. doi:10.1002/sim.70205

Yang, S., Troendle, J., Pak, D., & Leifer, E. (2022). Event‐specific win ratios for inference with terminal and non‐terminal events. Statistics in Medicine, 41(7), 1225–1241. doi:10.1002/sim.9266

Yang, S., & Troendle, J. (2021). Event-specific win ratios and testing with terminal and non-terminal events. Clinical Trials, 18(2), 180–187. doi:10.1177/1740774520972408

Bebu, I., & Lachin, J. M. (2016). Large sample inference for a win ratio analysis of a composite outcome based on prioritized components. Biostatistics, 17(1), 178–187. doi:10.1093/biostatistics/kxv032

Pocock, S. J., Ariti, C. A., Collier, T. J., & Wang, D. (2012). The win ratio: a new approach to the analysis of composite endpoints in clinical trials based on clinical priorities. European Heart Journal, 33(2), 176–182. doi:10.1093/eurheartj/ehr352

Finkelstein, D. M., & Schoenfeld, D. A. (1999). Combining mortality and longitudinal measures in clinical trials. Statistics in Medicine, 18(11), 1341–1354. doi:10.1002/(SICI)1097-0258(19990615)18:11<1341::AID-SIM129>3.0.CO;2-7

See Also

tnt.analysis

Examples

# Example: Treatment effect analysis using colon cancer trial data
data("colon_wr")

yh   <- colon_wr$yh     # non-terminal event time
hcen <- colon_wr$hcen   # censoring indicator for non-terminal event
yd   <- colon_wr$yd     # terminal event time
dcen <- colon_wr$dcen   # censoring indicator for terminal event
z    <- colon_wr$z      # treatment group (0 = control, 1 = treatment)

# Run the analysis
# The output includes test statistics and confidence intervals
# for RICH and RITCH measures (among others)
res <- tnt.analysis(
  yh, hcen, yd, dcen, z,
  lin   = c(0.5, 0.5),
  alpha = 0.05
)

# Display results
print(res)

Internal functions for the TxEffectsSurvival package

Description

This page documents internal functions of the TxEffectsSurvival package. These functions are not intended to be called directly by users, but rather support the implementation of user-facing functions such as tnt.analysis.

Value

No return value; these functions are called for their side effects or to support higher-level routines.


Colon cancer trial example data (Obs vs Lev+5FU) for semi-competing risks analyses

Description

A derived dataset from survival::colon, restricted to subjects in the Obs and Lev+5FU arms (excluding Lev). It is organized for semi-competing risks analyses with a non-terminal event (recurrence) and a terminal event (death). Each row corresponds to one subject.

Usage

data("colon_wr")

Format

A data frame with one row per subject and the following variables:

yh

Time to non-terminal event (recurrence).

hcen

Status for the non-terminal event: 1 = recurrence observed, 0 = censored.

yd

Time to terminal event (death).

dcen

Status for the terminal event: 1 = death observed, 0 = censored.

z

Treatment indicator: 0 = Obs, 1 = Lev+5FU.

Details

The source data are survival::colon. We first restrict to rx != "Lev" and then, per subject, extract event time/status for recurrence (etype = 1) and death (etype = 2). The original treatment factor is recoded to a binary indicator z \in \{0,1\}.

Source

survival package, dataset colon.

Examples

# Load example dataset
data("colon_wr")

# Contents of colon_wr:
#   yh    : Time to non-terminal event (recurrence)
#   hcen  : Event indicator for recurrence (1 = recurrence, 0 = censored)
#   yd    : Time to terminal event (death)
#   dcen  : Event indicator for death (1 = death, 0 = censored)
#   z     : Treatment group (0 = Obs, 1 = Lev+5FU)


Inference for Treatment Effects on Terminal and Non-Terminal Events under Competing Risks

Description

tnt.analysis provides several procedures for evaluating treatment effects on terminal and non-terminal events in the presence of competing risks. Based on the methodologies proposed in Yang et al. (2022) and Yang (2025), the function implements a variety of robust and flexible semiparametric and nonparametric estimation and hypothesis testing procedures that accommodate complex event-time structures with semi-competing risks.

Specifically, the function primarily provides the following inferential procedures for estimation and hypothesis testing:

Usage

## Default S3 method:
tnt.analysis(nonterm_time, nonterm_event, term_time, term_event, z,
lin = c(0.5, 0.5), alpha = 0.05, repnum = 1e6, tau_r = 0.9, ...)

Arguments

nonterm_time

A numeric vector indicating the time to the non-terminal event or censoring.

nonterm_event

A binary indicator for the non-terminal event (1 = event, 0 = censored).

term_time

A numeric vector indicating the time to the terminal event or censoring.

term_event

A binary indicator for the terminal event (1 = event, 0 = censored).

z

A numeric vector for the treatment group indicator (1 = treatment, 0 = control).

lin

A numeric vector of length 2 specifying the weights for the linear combination of event-specific estimates. The first element corresponds to the non-terminal event and the second to the terminal event. The weights must be non-negative and sum to one. Default is lin=c(0.5, 0.5).

alpha

The significance level used for confidence intervals and hypothesis testing. Default is alpha=0.05.

repnum

The number of Monte Carlo replications used to simulate bivariate normal distributions for critical value and p-value estimation. Default is repnum=1e6.

tau_r

A numeric value between 0 and 1 specifying the truncation proportion for the integration range [0, \tau] used in computing ICH and ITCH, where \tau = \texttt{tau\_r} \times \text{(total trial duration)}. Default is tau_r=0.9. For trials with very long follow-up, a smaller value (e.g., 0.8) may improve numerical stability. See details for the definition of total trial duration.

...

Additional arguments (currently ignored). Included for future extensibility.

Details

These methods follow the statistical inference framework proposed by Yang (2025), without relying on parametric assumptions or restrictive model specifications. They are well-suited for semi-competing risks settings, where non-terminal events (e.g., hospitalizations) may be censored by terminal events (e.g., death), and both types are clinically important.

Global tests—including the linear combination, maximum, and \chi^2 tests—offer flexible approaches to detecting treatment effects on either or both event types. Inference remains valid regardless of whether the proportional hazards assumption holds, with ICH and ITCH estimators providing additional robustness under non-proportional hazards.

In the implementation, the total trial duration is defined as \tau = \max(\{yh, yd\}) + 0.001. This upper bound is applied in the estimation of both ESWR and LRGRE. For ICH and ITCH, the analysis window is further truncated to \tau_0 = \tau \times \texttt{tau\_r}, where tau_r is a user-defined proportion (default = 0.9). Log transformations are used for the data-driven test, while log-log transformations are used for confidence intervals for non-terminal and terminal events. To improve finite-sample performance, a small-sample correction factor (cn) is applied to standard errors and test statistics. Specifically, cn = 1 + 15 / \max(n, 100) is used for the chi-square test and the maximum test, while cn = 1 + 10 / \max(n, 100) is used for the data-driven test and the corresponding confidence intervals.

To apply the package for univariate survival data analysis, see Example 2 in the Examples section below.

Value

An object of class "tnt.analysis", which is a named list containing the following elements:

sum_table

A contingency table summarizing the observed event patterns.

wrlin

Estimated win ratio from a linear combination of event-specific win ratios using user-specified weights lin.

rho

Estimated correlation between the event-specific test statistics (non-terminal and terminal).

pvalinall

Two-sided p-value for the linear combination test.

lin_ar

Data-driven linear combination weights.

wrlin_ar

Estimated win ratio from the data-adaptive linear combination lin_ar.

lincileswr

Confidence interval for the data-adaptive win ratio estimate, constructed on the log-transformed scale.

peswrlog

Two-sided p-value for the global test based on the log-transformed ESWR and data-adaptive weights.

chi, pvachi

Chi-square test statistic and its corresponding p-value.

mx, pvalmx

Maximum-type test statistic and corresponding Monte Carlo-based p-values.

logrank

Standard log-rank test result.

wrtest0

Unadjusted win ratio test result based on time to first event.

zvaephl, pvaephl

Z-statistic and p-value for testing the equality of hazard ratios between terminal and non-terminal events.

pvalph

P-value for testing the proportional hazards assumptions for both event types.

ci1, ci2

Pointwise confidence intervals for the event-specific win ratios for the non-terminal and terminal events, respectively.

cil

Confidence interval for the linear combination of win ratios using user-defined weights lin.

References

Yang, S. (2025). Testing and Estimation of Treatment Effects in Clinical Trials for Terminal and Non-Terminal Events Subject to Competing Risks. Statistics in Medicine. doi:10.1002/sim.70205

Yang, S., Troendle, J., Pak, D., & Leifer, E. (2022). Event‐specific win ratios for inference with terminal and non‐terminal events. Statistics in Medicine, 41(7), 1225–1241. doi:10.1002/sim.9266

Examples

# Example 1: joint analysis of non-terminal and terminal events
data("colon_wr")

yh   <- colon_wr$yh     # non-terminal event time
hcen <- colon_wr$hcen   # censoring indicator for non-terminal event
yd   <- colon_wr$yd     # terminal event time
dcen <- colon_wr$dcen   # censoring indicator for terminal event
z    <- colon_wr$z      # treatment group (0 = control, 1 = treatment)

# Run the analysis
# The output includes test statistics and confidence intervals
# for RICH and RITCH measures (among others)
res <- tnt.analysis(
  yh, hcen, yd, dcen, z,
  lin   = c(0.5, 0.5),
  alpha = 0.05
)

# Display results
print(res)

# Example 2: univariate analysis (workaround)
# tnt.analysis is primarily designed for joint analysis of non-terminal and terminal events,
# but univariate analysis can be conducted by assigning identical inputs to both.

res <- tnt.analysis(yh, hcen, yh, hcen, z)
res$global.tests$lincomb
res$ci.results$lincomb