find_scores {nphRCT} | R Documentation |
Calculate scores
Description
Weighted log-rank tests can also be thought in terms of assigning a score to the each of
the events (including censoring) and comparing the average score on each arm, see Magirr (2021) doi:10.1002/pst.2091.
This function calculates the scores
for different types of weighted log-rank test,
the modestly-weighted log-rank test and the Fleming-Harrington (\rho
,\gamma
)
test, in addition to the standard log-rank test.
Usage
find_scores(
formula,
data,
method,
t_star = NULL,
s_star = NULL,
rho = NULL,
gamma = NULL,
tau = NULL,
timefix = TRUE
)
Arguments
formula |
Formula object. The response (on the left of the |
data |
Data frame containing time-to-event data. |
method |
Character string specifying type of method to calculate scores. Either one of the weighted log-rank tests
(log-rank |
t_star |
Parameter |
s_star |
Parameter |
rho |
Parameter |
gamma |
Parameter |
tau |
Parameter |
timefix |
Deal with floating point issues (as in the survival package). Default is TRUE. May need to set FALSE for simulated data. |
Details
Select which of the tests to perform using argument method
.
For the weighted log-rank tests, the output is calculated as outlined in vignette("weighted_log_rank_tests", package="nphRCT")
.
Value
Data frame. Each row corresponds to an event or censoring time.
At each time specified in t_j
the columns indicate
-
event
the event indicator -
group
the treatment arm indicator -
score
the assigned score at timet_j
-
standardized_score
the value ofscore
standardized to be between -1 and 1
References
Magirr, D. (2021). Non-proportional hazards in immuno-oncology: Is an old perspective needed?. Pharmaceutical Statistics, 20(3), 512-527. doi:10.1002/pst.2091
Magirr, D. and Burman, C.F., 2019. Modestly weighted logrank tests. Statistics in medicine, 38(20), 3782-3790.
Examples
library(nphRCT)
set.seed(1)
sim_data <- sim_events_delay(
event_model=list(
duration_c = 36,
duration_e = c(6,30),
lambda_c = log(2)/9,
lambda_e = c(log(2)/9,log(2)/18)
),
recruitment_model=list(
rec_model="power",
rec_period = 12,
rec_power = 1
),
n_c=50,
n_e=50,
max_cal_t = 36
)
df_scores<-find_scores(formula=Surv(event_time,event_status)~group,
data=sim_data,
method="mw",
t_star = 4
)
plot(df_scores)