Simulates datasets to evaluate the performance of various recensoring strategies under the Rank Preserving Structural Failure Time Model (RPSFTM) for handling treatment switching in survival analysis.
recensor_sim_rpsftm(
nsim = NA_integer_,
n = NA_integer_,
shape = NA_real_,
scale = NA_real_,
gamma = NA_real_,
tfmin = NA_real_,
tfmax = NA_real_,
psi = NA_real_,
omega = NA_real_,
pswitch = NA_real_,
a = NA_real_,
b = NA_real_,
low_psi = -1,
hi_psi = 1,
treat_modifier = 1,
recensor_type = 1L,
admin_recensor_only = 1L,
autoswitch = 1L,
alpha = 0.05,
ties = "efron",
tol = 1e-06,
boot = 1L,
n_boot = 1000L,
seed = NA_integer_
)
A data frame summarizing the simulation results, including:
recensor_type
, admin_recensor_only
: Settings
used in the simulation.
Event rates: p_event_1
, p_dropout_1
,
p_admin_censor_1
, p_event_0
,
p_dropout_0
, p_admin_censor_0
.
Progression and switching: p_pd_0
, p_swtrt_0
,
p_recensored_0
.
Causal parameter (\(\psi\)) estimates: psi
,
psi_est
, psi_bias
,
psi_se
, psi_mse
.
Log hazard ratio estimates: loghr
, loghr_est
,
loghr_se
, loghr_mse
.
Hazard ratio metrics: hr
, hr_est
(geometric mean),
hr_pctbias
(percent bias).
Standard errors of log hazard ratio: loghr_se_cox
,
loghr_se_lr
, loghr_se_boot
.
Coverage probabilities: hr_ci_cover_cox
,
hr_ci_cover_lr
, hr_ci_cover_boot
.
Number of simulated datasets.
Number of subjects per simulation.
Shape parameter of the Weibull distribution for time to death.
Scale parameter of the Weibull distribution for time to death in the control group.
Rate parameter of the exponential distribution for random dropouts in the control group.
Minimum planned follow-up time (in days).
Maximum planned follow-up time (in days).
Log time ratio of death time for control vs experimental treatment.
Log time ratio of dropout time for control vs experimental treatment.
Probability of treatment switching at disease progression.
Shape parameter 1 of the Beta distribution for time to disease progression as a fraction of time to death.
Shape parameter 2 of the Beta distribution for time to disease progression.
Lower bound for the search interval of the causal parameter \(\psi\).
Upper bound for the search interval of the causal parameter \(\psi\).
Sensitivity parameter modifying the constant treatment effect assumption.
Type of recensoring to apply:
0: No recensoring
1: Recensor all control-arm subjects
2: Recensor only switchers in the control arm
3: Recensor only control-arm switchers whose counterfactual survival exceeds the planned follow-up time
Logical. If TRUE
, recensoring is
applied only to administrative censoring times.
If FALSE
, it is also applied to dropout times.
Logical. If TRUE
, disables recensoring in arms
without any treatment switching.
Significance level for confidence interval calculation (default is 0.05).
Method for handling tied event times in the Cox model.
Options are "efron"
(default) or "breslow"
.
Convergence tolerance for root-finding in estimation of \(\psi\).
Logical. If TRUE
, bootstrap is used to estimate
the confidence interval for the hazard ratio. If FALSE
,
the confidence interval is matched to the log-rank p-value.
Number of bootstrap samples, used only if
boot = TRUE
.
Optional. Random seed for reproducibility. If not provided, the global seed is used.
Kaifeng Lu, kaifenglu@gmail.com
# \donttest{
result <- recensor_sim_rpsftm(
nsim = 10, n = 400, shape = 1.5, scale = exp(6.3169),
gamma = 0.001, tfmin = 407.5, tfmax = 407.5,
psi = log(0.5) / 1.5, omega = log(1), pswitch = 0.7,
a = 2, b = 4, low_psi = -5, hi_psi = 5,
treat_modifier = 1, recensor_type = 1,
admin_recensor_only = TRUE, autoswitch = TRUE,
alpha = 0.05, tol = 1e-6, boot = TRUE,
n_boot = 10, seed = 314159)
# }
Run the code above in your browser using DataLab