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 both arms use the same truncation horizon \(\tau\). By default \(\tau\) is the smaller of the two arms' maximum follow-up times; it can be fixed by the user (e.g. tau = 36 for "RMST at 36 months") via the tau constructor argument. The horizon is set once, from the observed data (or the user's tau), and then held fixed in every randomization, randomization-bootstrap, bootstrap and jackknife draw; it is not recomputed from each draw's arms. A horizon recomputed per draw would depend on the assignment, so the null distribution would compare RMSTs over different horizons than the observed statistic and the randomization test could lose almost all its power. Prespecifying tau in the trial protocol (for example the planned follow-up) is still recommended: the default horizon is itself data-dependent. Each RMST is the area under its Kaplan-Meier survival curve up to that horizon (\(\hat\mu(\tau) = \int_0^\tau \hat S(t)\,dt\)), computed by exact integration of the step-function KM curve (a sum of rectangles). 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() and $compute_asymp_two_sided_pval() return NA, with the reason recorded and an edi_wald_unavailable_warning; before EDI 1.0.6 they fell back to a nonparametric bootstrap (v1.0.6-TODO-380). On left- or interval-censored data, which have no analytic standard error, they return the nonparametric bootstrap interval and p-value. Randomization confidence intervals are not supported (the RMST-difference units are not commensurate with the randomization CI bisection algorithm's transformed-scale null search). Randomization-bootstrap confidence intervals (every type) are refused for the same reason: they invert a log-time shift, so their bounds are for a log-time ratio. The randomization and randomization-bootstrap p-values at \(\delta = 0\) remain available.

The standard error assumes independent arms. The Greenwood-type variance treats the two arms as independent samples, which is correct for Bernoulli assignment and complete randomization (DesignSeqOneByOneBernoulli, DesignFixedBernoulli, DesignFixediBCRD, DesignSeqOneByOneiBCRD). Under every other design (blocking, stratified permuted blocks, matching, KK pairs, rerandomization, covariate-adaptive and other balancing designs) it ignores the balance the design enforces and is conservative: Wald intervals over-cover and Wald p-values are too large. Randomization tests and bootstrap intervals that resample according to the design do not share this issue. Design-aware variances are planned.

Left- or interval-censored data. The survival curve then comes from a Turnbull NPMLE (interval::icfit()) rather than Kaplan-Meier. Exact events are folded in as degenerate intervals \([y, y]\) (they are not dropped), right-censored subjects are \([y_L, \infty)\), and any row that cannot be used is excluded with a warning. Both arms are integrated to one shared horizon \(\tau\): the user's tau, or by default the smaller of the two arms' largest finite observed endpoints. Within a Turnbull interval the curve is not identified; it is taken to step down at the interval's left endpoint. An arm with no events before \(\tau\) has RMST equal to \(\tau\). The Bayesian bootstrap ($compute_bayesian_bootstrap_confidence_interval(), $compute_bayesian_bootstrap_two_sided_pval() and $approximate_bayesian_bootstrap_distribution_beta_hat_T()) stops with an error on left- or interval-censored data, because icfit() has no weights argument; use the nonparametric bootstrap there instead. On right-censored data it is unaffected.

Small-sample behaviour

How fast the size (and coverage) error of each procedure is expected to vanish as the effective sample size \(n_{eff}\) grows, from EDI's convergence-rate registry (inference_convergence_expectation()). Exact procedures are valid at every n by construction; the others are asymptotic, so a small-sample excess is expected, and its constant is not given by an order. The table is the expectation for a balanced complete-randomization design; it is not a measured size. Reference keys are explained under References.

ProcedureRegimeError orderEffective nRegularityBasisReferences
randfinite sampleexactsubjectsregulartheory[Fisher1935], [LehmannRomano2005]
waldasymptotic\(O(n_{eff}^{-1})\)subjectsregularassumed default[Hall1992]
jackknifeasymptotic\(O(n_{eff}^{-1})\)subjectsregularassumed default[ShaoTu1995]
bootstrapasymptotic\(O(n_{eff}^{-1})\)subjectsregularassumed default[Hall1992]
bayes_bootasymptotic\(O(n_{eff}^{-1})\)subjectsregularassumed default[Rubin1981], [Lo1987]
rand_bootstrapasymptotic\(O(n_{eff}^{-1})\)subjectsregularassumed default[Hall1992], [Kallus2018]

The point estimate's bias is of order \(O(n_{eff}^{-1})\) (assumed default: [CoxSnell1968]).

Rows with basis assumed default: the order shown is the procedure's rate in a regular parametric model, and the cited works establish it for that case only. EDI has not derived it for this class.

Design-specific differences from the table:

  • On any design with unequal allocation (prob_T not 0.5), for wald, jackknife, bootstrap, bayes_boot, rand_bootstrap: the effective n is the size of the smaller arm.

  • On DesignFixedBlockedCluster, DesignFixedCluster, for wald, jackknife, bootstrap, bayes_boot, rand_bootstrap: the effective n is the number of clusters.

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.

[Fisher1935] Fisher, R. A. (1935). The Design of Experiments. Oliver and Boyd.

[LehmannRomano2005] Lehmann, E. L., and Romano, J. P. (2005). Testing Statistical Hypotheses (3rd ed.). Springer.

[Hall1992] Hall, P. (1992). The Bootstrap and Edgeworth Expansion. Springer.

[ShaoTu1995] Shao, J., and Tu, D. (1995). The Jackknife and Bootstrap. Springer.

[Rubin1981] Rubin, D. B. (1981). "The Bayesian Bootstrap." The Annals of Statistics, 9(1), 130-134.

[Lo1987] Lo, A. Y. (1987). "A Large Sample Study of the Bayesian Bootstrap." The Annals of Statistics, 15(1), 360-375.

[Kallus2018] Kallus, N. (2018). "Optimal a priori balance in the design of controlled experiments." Journal of the Royal Statistical Society: Series B, 80(1), 85-112. Section 5 ("Algorithms for inference"), Algorithm 4.

[CoxSnell1968] Cox, D. R., and Snell, E. J. (1968). "A General Definition of Residuals." Journal of the Royal Statistical Society: Series B, 30(2), 248-265 (discussion 265-275).

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,
  tau = 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.

tau

Optional user-chosen restriction horizon \(\tau\) (a single finite positive number, on the response's time scale). If NULL (default) the shared horizon is the smaller of the two arms' maximum follow-up times in the observed data. Users may prespecify tau (recommended, e.g. the protocol's planned follow-up); a prespecified horizon does not depend on the data at all. If given, \(\tau\) must not exceed that smaller maximum (the KM curve is not identified past an arm's last observation). Either way, the point estimate, Greenwood standard error, Bayesian/nonparametric bootstrap, jackknife, randomization and randomization-bootstrap paths all use this same \(\tau\), fixed at construction and never recomputed from a draw's arms. In a resample whose smaller arm maximum falls below \(\tau\), the smaller maximum is used for that resample. For left-/interval-censored data the Turnbull step function is integrated exactly up to \(\tau\).


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). NA (reason recorded, with an edi_wald_unavailable_warning) if that standard error is unavailable or non-finite; no bootstrap is substituted (v1.0.6-TODO-380). On left- or interval-censored data, which have no analytic standard error, the nonparametric bootstrap interval.

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. NA (reason recorded, with an edi_wald_unavailable_warning) if that standard error is unavailable (v1.0.6-TODO-380); the nonparametric bootstrap p-value on left- or interval-censored data.

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.02056103
# }