
Gehan-Wilcoxon (Peto-Prentice) Inference for Survival Data with Censoring
Source:R/inference_survival_gehan_wilcox.R
InferenceSurvivalGehanWilcox.RdNon-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.
| Procedure | Regime | Error order | Effective n | Regularity | Basis | References |
rand | finite sample | exact | subjects | regular | theory | [Fisher1935], [LehmannRomano2005] |
wald | asymptotic | \(O(n_{eff}^{-1})\) | subjects | regular | assumed default | [Hall1992] |
jackknife | asymptotic | \(O(n_{eff}^{-1})\) | subjects | regular | assumed default | [ShaoTu1995] |
bootstrap | asymptotic | \(O(n_{eff}^{-1})\) | subjects | regular | assumed default | [Hall1992] |
bayes_boot | asymptotic | \(O(n_{eff}^{-1})\) | subjects | regular | assumed default | [Rubin1981], [Lo1987] |
rand_bootstrap | asymptotic | \(O(n_{eff}^{-1})\) | subjects | regular | assumed 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_Tnot 0.5), forwald,jackknife,bootstrap,bayes_boot,rand_bootstrap: the effective n is the size of the smaller arm.On
DesignFixedBlockedCluster,DesignFixedCluster, forwald,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
Public methods
+ inherited public methods from Inference
Inference$capabilities()Inference$clear_randomization_cache()Inference$compute_exact_confidence_interval()Inference$compute_exact_two_sided_pval_for_treatment_effect()Inference$duplicate()Inference$get_analysis_data()Inference$get_covariates()Inference$get_design_object()Inference$get_estimand()Inference$get_model_formula()Inference$get_nonestimable_reason()Inference$get_nonestimable_stage()Inference$get_optimization_alg()Inference$get_procedure_validity()Inference$get_response()Inference$get_response_type()Inference$get_summary()Inference$get_supported_estimands()Inference$get_treatment()Inference$is_nonestimable()Inference$set_estimand()Inference$set_optimization_alg()Inference$set_seed()Inference$supports()
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_objThe design object.
model_formulaOptional 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.verboseIf 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.
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.
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).
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).
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.
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