Skip to contents

Non-parametric inference for survival outcomes supporting censored data, using the Peto-Prentice modification of the Gehan-Wilcoxon test. The treatment effect estimate is the mean difference in Peto-Prentice weighted martingale residuals between the treatment and control groups. Specifically, for each subject the weighted residual is \(M_i^w = \hat{S}(t_i^-) \cdot M_i\), where \(M_i = \delta_i - \hat\Lambda_0(t_i)\) is the martingale residual and \(\hat{S}(t_i^-)\) is the overall Kaplan-Meier survival estimate just before time \(t_i\). These weights downweight late events, analogously to the Wilcoxon rank-sum test for uncensored data (which also weights early observations more heavily via their larger rank denominator).

The p-value uses survival::survdiff(rho = 1) (Peto-Prentice / Fleming-Harrington p=1, q=0), which is distinct from the log-rank test (rho = 0) used in InferenceSurvivalKMDiff.

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 the weighted Peto-Prentice re-estimate assumes right-censoring (coxph()/survfit()) and the interval-censored fit takes no case weights; 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

Gehan, E. A. (1965). "A generalized Wilcoxon test for comparing arbitrarily singly-censored samples." Biometrika, 52(1-2), 203-223, doi:10.1093/biomet/52.1-2.203 , for the original generalized (Gehan) Wilcoxon test for censored data. Peto, R., and Peto, J. (1972). "Asymptotically Efficient Rank Invariant Test Procedures." Journal of the Royal Statistical Society, Series A, 135(2), 185-207, doi:10.2307/2344317 , for the survival-weighted (Peto-Prentice) modification this class implements via \(\rho=1\).

[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 -> InferenceSurvivalGehanWilcox

Methods

+ inherited public methods from Inference


InferenceSurvivalGehanWilcox$new()

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

Initialize Gehan-Wilcoxon survival inference and prepare the rank-based treatment statistic used by InferenceSurvivalGehanWilcox.

Usage

InferenceSurvivalGehanWilcox$new(
  des_obj,
  model_formula = NULL,
  verbose = FALSE
)

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.


InferenceSurvivalGehanWilcox$compute_estimate()

Returns the mean difference in Peto-Prentice weighted martingale residuals between the treatment and control groups. Positive values indicate that treatment subjects experienced more early events than expected (worse early survival). For left- or interval-censored data, dispatches instead to interval::ictest(..., scores = "wmw") (the Wilcoxon-Mann-Whitney interval-censored generalization of the Peto-Prentice test) and returns its estimate.

Usage

InferenceSurvivalGehanWilcox$compute_estimate(estimate_only = FALSE)

Arguments

estimate_only

If TRUE, skip variance component calculations.

Returns

A numeric scalar (the Peto-Prentice weighted score treatment effect estimate).

Examples

seq_des = DesignSeqOneByOneBernoulli$new(n = 6, response_type = "survival")
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[1, 2:10])
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[2, 2:10])
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[3, 2:10])
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[4, 2:10])
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[5, 2:10])
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[6, 2:10])
seq_des$add_all_subject_responses(
  ys = c(4.71, NA, 4.78, 6.11, NA, 8.43),
  y_Ls = c(NA, 1.23, NA, NA, 5.95, NA),
  y_Rs = c(NA, Inf, NA, NA, Inf, NA)
)

seq_des_inf = InferenceSurvivalGehanWilcox$new(seq_des)
seq_des_inf$compute_estimate()


InferenceSurvivalGehanWilcox$compute_estimate_with_bootstrap_weights()

Recomputes the class-specific treatment estimate under bootstrap weights; see InferenceBayesianBootstrap.

Usage

InferenceSurvivalGehanWilcox$compute_estimate_with_bootstrap_weights(
  subject_or_block_weights,
  estimate_only = FALSE
)

Arguments

subject_or_block_weights

Bootstrap weights at the subject or block level.

estimate_only

If TRUE, skip variance calculations.


InferenceSurvivalGehanWilcox$compute_asymp_confidence_interval()

Computes a (1 - alpha)-level confidence interval based on the asymptotic normality of the Peto-Prentice weighted martingale residual mean difference. When the SE is unavailable the interval is NA, with the reason recorded and an edi_wald_unavailable_warning; no bootstrap interval is substituted (v1.0.6-TODO-380; call compute_bootstrap_confidence_interval() for one).

Usage

InferenceSurvivalGehanWilcox$compute_asymp_confidence_interval(alpha = 0.05)

Arguments

alpha

Significance level. Default is 0.05.

Returns

A numeric vector of length 2: (lower, upper) confidence bounds.

Examples

seq_des = DesignSeqOneByOneBernoulli$new(n = 6, response_type = "survival")
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[1, 2:10])
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[2, 2:10])
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[3, 2:10])
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[4, 2:10])
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[5, 2:10])
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[6, 2:10])
seq_des$add_all_subject_responses(
  ys = c(4.71, NA, 4.78, 6.11, NA, 8.43),
  y_Ls = c(NA, 1.23, NA, NA, 5.95, NA),
  y_Rs = c(NA, Inf, NA, NA, Inf, NA)
)

seq_des_inf = InferenceSurvivalGehanWilcox$new(seq_des)
seq_des_inf$compute_asymp_confidence_interval()


InferenceSurvivalGehanWilcox$compute_asymp_two_sided_pval()

Computes the Peto-Prentice (Gehan-Wilcoxon) two-sided p-value via survival::survdiff(rho = 1), which puts greater weight on early events relative to the standard log-rank test (rho = 0). For delta != 0, not yet implemented. On left- or interval-censored data this is interval::ictest()'s p-value; when that is unavailable the p-value is NA, with the reason recorded under procedure_failure_reason$rank_test and an edi_rank_test_unavailable_warning; no bootstrap p-value is substituted (v1.0.6-TODO-417; call compute_bootstrap_two_sided_pval() for one).

Usage

InferenceSurvivalGehanWilcox$compute_asymp_two_sided_pval(delta = 0)

Arguments

delta

Null treatment effect to test against. Default is 0.

Returns

A p-value in [0, 1], or NA as above.

Examples

seq_des = DesignSeqOneByOneBernoulli$new(n = 6, response_type = "survival")
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[1, 2:10])
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[2, 2:10])
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[3, 2:10])
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[4, 2:10])
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[5, 2:10])
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[6, 2:10])
seq_des$add_all_subject_responses(
  ys = c(4.71, NA, 4.78, 6.11, NA, 8.43),
  y_Ls = c(NA, 1.23, NA, NA, 5.95, NA),
  y_Rs = c(NA, Inf, NA, NA, Inf, NA)
)

seq_des_inf = InferenceSurvivalGehanWilcox$new(seq_des)
seq_des_inf$compute_asymp_two_sided_pval()


InferenceSurvivalGehanWilcox$compute_rand_confidence_interval()

Randomization confidence intervals are not supported for this class because the Peto-Prentice weighted score scale is not commensurate with the time-ratio null used by the randomization CI bisection algorithm.

Usage

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

Arguments

alpha

Unused.

r

Unused.

pval_epsilon

Unused.

show_progress

Unused.

ci_search_control

Unused.


InferenceSurvivalGehanWilcox$clone()

The objects of this class are cloneable with this method.

Usage

InferenceSurvivalGehanWilcox$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 = InferenceSurvivalGehanWilcox$new(seq_des)
inf$compute_estimate()
#> [1] 0.4558095
# }

## ------------------------------------------------
## Method `InferenceSurvivalGehanWilcox$compute_estimate()`
## ------------------------------------------------

seq_des = DesignSeqOneByOneBernoulli$new(n = 6, response_type = "survival")
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[1, 2:10])
#> [1] 0
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[2, 2:10])
#> [1] 1
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[3, 2:10])
#> [1] 1
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[4, 2:10])
#> [1] 0
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[5, 2:10])
#> [1] 0
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[6, 2:10])
#> [1] 0
seq_des$add_all_subject_responses(
  ys = c(4.71, NA, 4.78, 6.11, NA, 8.43),
  y_Ls = c(NA, 1.23, NA, NA, 5.95, NA),
  y_Rs = c(NA, Inf, NA, NA, Inf, NA)
)

seq_des_inf = InferenceSurvivalGehanWilcox$new(seq_des)
seq_des_inf$compute_estimate()
#> [1] 0.15125

## ------------------------------------------------
## Method `InferenceSurvivalGehanWilcox$compute_asymp_confidence_interval()`
## ------------------------------------------------

seq_des = DesignSeqOneByOneBernoulli$new(n = 6, response_type = "survival")
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[1, 2:10])
#> [1] 0
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[2, 2:10])
#> [1] 1
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[3, 2:10])
#> [1] 1
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[4, 2:10])
#> [1] 0
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[5, 2:10])
#> [1] 0
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[6, 2:10])
#> [1] 0
seq_des$add_all_subject_responses(
  ys = c(4.71, NA, 4.78, 6.11, NA, 8.43),
  y_Ls = c(NA, 1.23, NA, NA, 5.95, NA),
  y_Rs = c(NA, Inf, NA, NA, Inf, NA)
)

seq_des_inf = InferenceSurvivalGehanWilcox$new(seq_des)
seq_des_inf$compute_asymp_confidence_interval()
#>       2.5%      97.5% 
#> -0.5078243  0.8103243 

## ------------------------------------------------
## Method `InferenceSurvivalGehanWilcox$compute_asymp_two_sided_pval()`
## ------------------------------------------------

seq_des = DesignSeqOneByOneBernoulli$new(n = 6, response_type = "survival")
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[1, 2:10])
#> [1] 1
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[2, 2:10])
#> [1] 1
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[3, 2:10])
#> [1] 1
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[4, 2:10])
#> [1] 0
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[5, 2:10])
#> [1] 1
seq_des$add_one_subject_to_experiment_and_assign(MASS::biopsy[6, 2:10])
#> [1] 0
seq_des$add_all_subject_responses(
  ys = c(4.71, NA, 4.78, 6.11, NA, 8.43),
  y_Ls = c(NA, 1.23, NA, NA, 5.95, NA),
  y_Rs = c(NA, Inf, NA, NA, Inf, NA)
)

seq_des_inf = InferenceSurvivalGehanWilcox$new(seq_des)
seq_des_inf$compute_asymp_two_sided_pval()
#> [1] 0.2059032