wlr {simtrial} | R Documentation |
Weighted logrank test
Description
Weighted logrank test
Usage
wlr(data, weight, return_variance = FALSE)
Arguments
data |
Dataset that has been cut, generated by |
weight |
Weighting functions, such as |
return_variance |
A logical flag that, if |
Details
-
- Standardized normal Fleming-Harrington weighted logrank test.
-
- Stratum index.
-
- Number of distinct times at which events occurred in stratum
.
-
- Ordered times at which events in stratum
,
were observed; for each observation,
represents the time post study entry.
-
- Total number of events in stratum
that occurred at time
.
-
- Total number of events in stratum
in the experimental treatment group that occurred at time
.
-
- Total number of study subjects in stratum
who were followed for at least duration.
-
- Expected observations in experimental treatment group given random selection of
from those in stratum
at risk at time
.
-
- Hypergeometric variance for
as produced in
Var
fromcounting_process()
. -
- Total number of study subjects in stratum
in the experimental treatment group who were followed for at least duration
.
-
- Expected observations in experimental group in stratum
at time
conditioning on the overall number of events and at risk populations at that time and sampling at risk observations without replacement:
-
- Kaplan-Meier estimate of survival in combined treatment groups immediately prior to time
.
-
- Real parameters for Fleming-Harrington test.
-
- Numerator for signed logrank test in stratum
-
- Variance used in denominator for Fleming-Harrington weighted logrank tests
The stratified Fleming-Harrington weighted logrank test is then computed as:
Value
A list containing the test method (method
),
parameters of this test method (parameter
),
point estimation of the treatment effect (estimation
),
standardized error of the treatment effect (se
),
Z-score (z
), p-values (p_value
).
Examples
x <- sim_pw_surv(n = 200) |> cut_data_by_event(100)
# Example 1: WLR test with FH wights
x |> wlr(weight = fh(rho = 0, gamma = 1))
x |> wlr(weight = fh(rho = 0, gamma = 1), return_variance = TRUE)
# Example 2: WLR test with MB wights
x |> wlr(weight = mb(delay = 4, w_max = 2))
# Example 3: WLR test with early zero wights
x |> wlr(weight = early_zero(early_period = 4))