Skip to contents

Fits a non-parametric treatment-effect estimator for censored survival responses: the difference in restricted mean survival time (RMST) between the treated and control arms, \(\hat\mu_T(\tau) - \hat\mu_C(\tau)\), where each arm's RMST is the area under its Kaplan-Meier survival curve up to a truncation horizon \(\tau\) (\(\hat\mu(\tau) = \int_0^\tau \hat S(t)\,dt\)), computed by trapezoidal integration of the step-function KM curve. The standard error of the difference comes from the Greenwood-type variance of each arm's RMST, combined across the two (independent) arms via get_restricted_mean_se_diff(). When that standard error is unavailable or non-finite, $compute_asymp_confidence_interval() falls back to a nonparametric bootstrap interval rather than returning NA. Randomization confidence intervals are not supported (the RMST-difference units are not commensurate with the randomization CI bisection algorithm's transformed-scale null search).

References

Royston, P., and Parmar, M. K. B. (2013). "Restricted mean survival time: an alternative to the hazard ratio for the design and analysis of randomized trials with a time-to-event outcome." BMC Medical Research Methodology, 13, 152, doi:10.1186/1471-2288-13-152 , for RMST as a treatment-effect summary. Kaplan, E. L., and Meier, P. (1958). "Nonparametric Estimation from Incomplete Observations." Journal of the American Statistical Association, 53(282), 457-481, doi:10.2307/2281868 , for the underlying survival curve estimator each arm's RMST is integrated from.

Super class

Inference -> InferenceSurvivalRestrictedMeanDiff

Methods

+ inherited public methods from Inference


InferenceSurvivalRestrictedMeanDiff$new()

Uses the shared randomization two-sided p-value contract; see InferenceRand.

Initialize restricted-mean-survival-time difference inference and prepare treatment-group survival summaries used by InferenceSurvivalRestrictedMeanDiff.

Usage

InferenceSurvivalRestrictedMeanDiff$new(
  des_obj,
  model_formula = NULL,
  verbose = FALSE,
  smart_cold_start_default = NULL
)

Arguments

des_obj

The design object.

model_formula

Optional formula for covariate adjustment. If NULL (default), the formula from the design object is used and its pre-computed design matrix is reused. If a formula is provided, a new design matrix is constructed from the design's imputed covariates.

verbose

If TRUE, print additional information.

smart_cold_start_default

Whether to use smart cold start values by default.


InferenceSurvivalRestrictedMeanDiff$compute_estimate()

Computes the class-specific mean or survival contrast; see InferenceMLEorKMSummaryTable.

Usage

InferenceSurvivalRestrictedMeanDiff$compute_estimate(estimate_only = FALSE)

Arguments

estimate_only

If TRUE, skip variance component calculations.

Returns

The setting-appropriate (see description) numeric estimate of the treatment effect


InferenceSurvivalRestrictedMeanDiff$compute_estimate_with_bootstrap_weights()

Recomputes the class-specific treatment estimate for a bootstrap sample; see InferenceNonParamBootstrap.

Usage

InferenceSurvivalRestrictedMeanDiff$compute_estimate_with_bootstrap_weights(
  subject_or_block_weights,
  estimate_only = FALSE
)

Arguments

subject_or_block_weights

Row weights for the bootstrap sample.

estimate_only

If TRUE, skip variance calculations.


InferenceSurvivalRestrictedMeanDiff$compute_asymp_confidence_interval()

Computes a \(1-\alpha\) level Wald confidence interval for the RMST-difference treatment effect \(\hat\mu_T(\tau) - \hat\mu_C(\tau)\), using its Greenwood-based standard error (see class documentation). Falls back to a nonparametric bootstrap interval if that standard error is unavailable or non-finite.

Usage

InferenceSurvivalRestrictedMeanDiff$compute_asymp_confidence_interval(
  alpha = 0.05
)

Arguments

alpha

The confidence level in the computed confidence interval is 1 - alpha. The default is 0.05.

Returns

A (1 - alpha)-sized frequentist confidence interval for the treatment effect


InferenceSurvivalRestrictedMeanDiff$compute_asymp_two_sided_pval()

Computes a two-sided Wald p-value testing \(H_0: \mu_T(\tau) - \mu_C(\tau) = 0\) (only delta = 0 is currently supported; a non-zero null raises an error), using the RMST-difference estimate and its Greenwood-based standard error — see class documentation. Falls back to a nonparametric bootstrap p-value if that standard error is unavailable.

Usage

InferenceSurvivalRestrictedMeanDiff$compute_asymp_two_sided_pval(delta = 0)

Arguments

delta

The null difference to test against. For any treatment effect at all this is set to zero (the default).

Returns

The approximate frequentist p-value


InferenceSurvivalRestrictedMeanDiff$compute_rand_confidence_interval()

Uses the shared randomization confidence-interval contract; see InferenceRandCI.

Usage

InferenceSurvivalRestrictedMeanDiff$compute_rand_confidence_interval(
  alpha = 0.05,
  r = 501,
  pval_epsilon = 0.005,
  show_progress = TRUE,
  ci_search_control = NULL
)

Arguments

alpha

The confidence level in the computed confidence interval is 1 - alpha. The default is 0.05.

r

The number of randomization vectors. The default is 501.

pval_epsilon

The bisection algorithm tolerance. The default is 0.005.

show_progress

Show a text progress indicator.

ci_search_control

Unused.

Returns

A 1 - alpha sized frequentist confidence interval


InferenceSurvivalRestrictedMeanDiff$clone()

The objects of this class are cloneable with this method.

Usage

InferenceSurvivalRestrictedMeanDiff$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

# \donttest{
seq_des = DesignSeqOneByOneBernoulli$new(n = 10, response_type = 'survival')
for (i in 1:10) {
  seq_des$add_one_subject_to_experiment_and_assign(data.frame(x1 = rnorm(1)))
}
seq_des$add_all_subject_responses(runif(10))
inf = InferenceSurvivalRestrictedMeanDiff$new(seq_des)
inf$compute_estimate()
#> [1] 0.05757811
# }