generateSurvData {safestats} | R Documentation |
Generate Survival Data which Can Be Analysed With the 'survival' Package
Description
Generate Survival Data which Can Be Analysed With the 'survival' Package
Usage
generateSurvData(
nP,
nT,
alpha = 1,
lambdaP,
lambdaT,
seed = NULL,
nDigits = 0,
startTime = 1,
endTime = 180,
orderTime = TRUE,
competeRatio = 0
)
Arguments
nP |
integer > 0 representing the number of of patients in the placebo group. |
nT |
integer > 0 representing the number of of patients in the treatment group. |
alpha |
numeric > 0, representing the shape parameter of the Weibull distribution. If alpha=1, then data are generated from the exponential, i.e., constant hazard. For alpha > 1 the hazard increases, if alpha < 1, the hazard decreases. |
lambdaP |
The (relative) hazard of the placebo group. |
lambdaT |
The (relative) hazard of the treatment group. |
seed |
A seed number. |
nDigits |
numeric, the number of digits to round of the random time to |
startTime |
numeric, adds this to the random times. Default 1, so the startTime is not 0, which
is the start time of |
endTime |
The endtime of the experiment. |
orderTime |
logical, if |
competeRatio |
The ratio of the data that is due to competing risk. |
Value
A data set with time, status and group.
Examples
generateSurvData(800, 800, alpha=1, lambdaP=0.008, lambdaT=0.008/2)