Description Usage Arguments Details Value References Examples
View source: R/generate_data.R
Generate observed event times, covariates and other data used for simulations in the paper.
1 | generate_data(n, alpha, rho, beta_true, now_repeat = 1)
|
n |
number of subjects |
alpha |
parameter in transformation function |
rho |
parameter in baseline cumulative hazard function Λ(t) = ρ log(1+t) assumed in simulation |
beta_true |
parameter β |
now_repeat |
number of duplication of simulation |
The survival function for t of the ith observation takes the form
S_{i}(t| X_{i}) = \exp≤ft\{-H \{Λ(t) \exp ( β^T X_{i} ) \}\right\}.
The failure time T_i can be generated by
T_i = ≤ft\{\begin{array}{l l} \exp\{ \frac{U^{-α}-1}{αρ\exp\{β^TX_i \}} \}-1& α > 0, \\ \exp\{ \frac{-log(U)}{ρ\exp\{β^TX_i \}} \}-1, & α = 0. \end{array}\right\}
a list containing
X | design matrix | ||
beta_X | X\cdotβ^T | ||
Y | observed event time | ||
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.
1 | generate_data(200,0.5,1,c(0.5,-1))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.