R/simulation.R
SIM.FUN.TVC.Rd
SIM.FUN.TVC
generates time-dependent survival response with four time-intervals 0-1, 1-2, 2-3, 3-4 for each subject data. All subjects are administratively censored at 4, if T>4. T comes from a Weibull distribution with shape of 2.
The design matrix comes from a correlated multivariate normal. The default signals (beta0) are sparse.
SIM.FUN.TVC(p.ti = 50, p.tv = 50, n.subject = 1e+06, cor = 0.2, beta0.ti = NULL, beta0.tv = NULL)
p.ti | number of time-invariant covariates |
---|---|
p.tv | number of time-varying covariates |
n.subject | number of subjects |
cor | correlation between time-varying and each interval's time-varying covairates |
beta0.ti | coefficient for time-invariant covariates |
beta0.tv | coefficients for time-varying covariates |
a matrix with the first column starting time, second column ending time, third column event (0,1), and rest = design matrix + ID for subject.
Section 3.3 in Austin, P.C., 2012. Generating survival times to simulate Cox proportional hazards models with time‐varying covariates. Statistics in medicine, 31(29), pp.3946-3958.
Yan Wang, Tianxi Cai, Chuan Hong