| recensor_sim_rpsftm | R Documentation |
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_
)
nsim |
Number of simulated datasets. |
n |
Number of subjects per simulation. |
shape |
Shape parameter of the Weibull distribution for time to death. |
scale |
Scale parameter of the Weibull distribution for time to death in the control group. |
gamma |
Rate parameter of the exponential distribution for random dropouts in the control group. |
tfmin |
Minimum planned follow-up time (in days). |
tfmax |
Maximum planned follow-up time (in days). |
psi |
Log time ratio of death time for control vs experimental treatment. |
omega |
Log time ratio of dropout time for control vs experimental treatment. |
pswitch |
Probability of treatment switching at disease progression. |
a |
Shape parameter 1 of the Beta distribution for time to disease progression as a fraction of time to death. |
b |
Shape parameter 2 of the Beta distribution for time to disease progression. |
low_psi |
Lower bound for the search interval of the causal
parameter |
hi_psi |
Upper bound for the search interval of the causal
parameter |
treat_modifier |
Sensitivity parameter modifying the constant treatment effect assumption. |
recensor_type |
Type of recensoring to apply:
|
admin_recensor_only |
Logical. If |
autoswitch |
Logical. If |
alpha |
Significance level for confidence interval calculation (default is 0.05). |
ties |
Method for handling tied event times in the Cox model.
Options are |
tol |
Convergence tolerance for root-finding in estimation of
|
boot |
Logical. If |
n_boot |
Number of bootstrap samples, used only if
|
seed |
Optional. Random seed for reproducibility. If not provided, the global seed is used. |
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.
Kaifeng Lu, kaifenglu@gmail.com
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.