Generate observed event times, covariates and other data used for simulations in the paper.
generate_data(n, alpha, rho, beta_true, now_repeat = 1)number of subjects
parameter in transformation function
parameter in baseline cumulative hazard function \(\Lambda(t) = \rho log(1+t)\) assumed in simulation
parameter \(\beta\)
number of duplication of simulation
a list containing
X |
design matrix | ||
beta_X |
\(X\cdot\beta^T\) | ||
Y |
observed event time |
The survival function for \(t\) of the \(i\)th observation takes the form $$S_{i}(t| X_{i}) = \exp\left\{-H \{\Lambda(t) \exp ( \beta^T X_{i} ) \}\right\}.$$ The failure time \(T_i\) can be generated by $$ T_i = \left\{\begin{array}{l l} \exp\{ \frac{U^{-\alpha}-1}{\alpha\rho\exp\{\beta^TX_i \}} \}-1& \alpha > 0, \\ \exp\{ \frac{-log(U)}{\rho\exp\{\beta^TX_i \}} \}-1, & \alpha = 0. \end{array}\right\} $$
Abramowitz, M., and Stegun, I.A. (1972). Handbook of Mathematical Functions (9th ed.). Dover Publications, New York. +- Evans, M. and Swartz, T. (2000). Approximating Integrals via Monte Carlo and Deterministic Methods. Oxford University Press.
Liu, Q. and Pierce, D.A. (1994). A note on Gauss-Hermite quadrature. Biometrika 81: 624-629.
# NOT RUN {
generate_data(200,0.5,1,c(0.5,-1))
# }
Run the code above in your browser using DataLab