survdata | R Documentation |
Creates a data frame of survival data based on exponential distributions and Bernoulli censoring for a 2 arm trial.
survdata <- function(n, lambda1, lambda2, censor = 0, piecewise = FALSE, diverge_time = NULL, erate = NULL, eperiod = NULL, end_study = NULL)
n0 |
The sample size in the control arm. |
n1 |
The sample size in the treatment arm. |
lambda1 |
The rate of the exponential distribution in the first arm. |
lambda2 |
The rate of the exponential distribution in the second arm if piecewise = FALSE, or the rates of the piecewise exponential distribution of the second arm before diverge_time if piecewise = TRUE. |
censor |
The probability a sample time will be deemed a censored observation.
|
piecewise |
Determines if the second trial arm follows a piecewise exponential distribution. |
diverge_time |
Determines the point in time in which the piecewise exponential curve changes rates. |
erate |
Vector of enrollment rates following piecewise exponential distribution. |
eperiod |
Vector of length +1 to erate which determines the times at which the enrollment period begins (0), when the erates change, and when the enrollment period ends. |
end_study |
Creates a point at which all the simulated times are censored after. |
dataframe with observed times, calendar times, enrollment times, censoring indicators (0 for censoring, 1 for events), and trial arm.
Mitchell Paukner
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.