Description Usage Arguments Value Author(s) References See Also Examples
This function generates survival data according to the simulation scenarios considered in Section 4 of Wu, J., and Witten, D. (2019) Flexible and interpretable models for survival data. Cox model has the form
λ(t|x) = λ_0(t) exp(∑_{j=1}^p f_j(x))
. Failure time is generated by Weibull distribution with baseline hazard
λ_0(t) = scale * shape * t ^ {shape-1}
. In the paper, however, failure time is generated by a simplied weibull distribution: exponential(1) baseline hazard corresponding to shape=1 and scale=1. Censoring time is generated independently by exponential distribution with intensity censoring.rate. Thus the observed time is the minimum of failure time and censoring time. Each scenario has four covariates that have some non-linear association with the outcome. There is the option to also generate a user-specified number of covariates that have no association with the outcome.
1 |
n |
number of observations. |
scenario |
Simulation scenario. Options are 1, 2, 3, 4. Scenario 1 corresponds to piecewise constant functions, scenario 2 corresponds to smooth functions, scenario 3 corresponds to piecewise linear functions, and scenario 4 corresponds to functions that have varying degrees of smoothness. Each scenario has four covariates that have some non-linear association with the outcome. |
zerof |
Number of additional covariates that have no association with the outcome. The total number of covariates is |
scale |
scale parameter as in |
shape |
shape parameter as in |
censoring.rate |
censoring intensity. Censoring time is generated by exponential distribution with intensity |
n.discrete |
The number of binary covariates and default is zero binary covariate. |
time |
failure or censoring time whichever comes first. |
status |
censoring indicator. 1 denotes censoring and 0 denotes failure. |
X |
n x p covariate matrix. |
true_theta |
n x p matrix. |
Jiacheng Wu
Jiacheng Wu & Daniela Witten (2019) Flexible and Interpretable Models for Survival Data, Journal of Computational and Graphical Statistics, DOI: 10.1080/10618600.2019.1592758
1 2 3 4 5 | #generate data
set.seed(123)
dat = sim_dat(n=100, zerof=0, scenario=1)
#plot X versus the true theta
plot.sim_dat(dat)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.