simulate_crossterms {survcompare} | R Documentation |
Simulated sample with survival outcomes with non-linear and cross-term dependencies
Description
Simulated sample with exponentially or Weibull distributed time-to-event; log-hazard depends non-linearly on risk factors, and includes cross-terms.
Usage
simulate_crossterms(
N = 300,
observe_time = 10,
percentcensored = 0.75,
randomseed = NULL,
lambda = 0.1,
distr = "Exp",
rho_w = 1,
drop_out = 0.3
)
Arguments
N |
sample size, 300 by default |
observe_time |
study's observation time, 10 by default |
percentcensored |
expected number of non-events by observe_time, 0.75 by default (i.e. event rate is 0.25) |
randomseed |
random seed for replication |
lambda |
baseline hazard rate, 0.1 by default |
distr |
time-to-event distribution, "Exp" for exponential (default), "W" for Weibull |
rho_w |
shape parameter for Weibull distribution, 0.3 by default |
drop_out |
expected rate of drop out before observe_time, 0.3 by default |
Value
data frame; "time" and "event" columns describe survival outcome; predictors are "age", "sex", "hyp", "bmi"
Examples
mydata <- simulate_crossterms()
head(mydata)
[Package survcompare version 0.1.2 Index]