rLogrank: Randomly samples from a logrank distribution

View source: R/logRankTest.R

rLogrankR Documentation

Randomly samples from a logrank distribution

Description

Draws a number of occurrences in group 1 (treatment) out of obsTotal number of occurrences.

Usage

rLogrank(n = 1, y0, y1, obsTotal, theta)

Arguments

n

integer, number of observations to be sampled.

y0

Size of the risk set of group 0 (Placebo).

y1

Size of the risk set of group 1 (Treatment).

obsTotal

Total number of observations.

theta

Odds of group 1 over group 0 (treatment over placebo).

Value

integer representing the number of occurrences in group 1 out of obsTotal number of occurrences.

Author(s)

Muriel Felipe Perez-Ortiz and Alexander Ly

References

Grünwald, P. D., de Heide, R., & Koolen, W. (2024). Safe testing. Journal of the Royal Statistical Society. Series B (Methodological), 86(5), 1091-1128. (With discussions), https://doi.org/10.1093/jrsssb/qkae011. ter Schure, J., Pérez-Ortiz, M. F., Ly, A., & Grünwald, P. D. (2024). The Safe Logrank Test: Error control under continuous monitoring with unlimited horizon. The New England Journal of Statistics in Data Science, 2(2), 190-214, https://doi.org/10.51387/24-NEJSDS65.

Examples

rLogrank(y0=360, y1=89, obsTotal=12, theta=3.14)


safestats documentation built on Sept. 6, 2026, 1:06 a.m.