simSurv {SemiCompRisks} | R Documentation |
The function to simulate independent/cluster-correlated right-censored survival data under Weibull/Weibull-Normal model.
simSurv(id=NULL, x, beta.true, alpha.true, kappa.true, sigmaV.true=NULL, cens)
id |
a vector of cluster information for |
x |
covariate matrix, |
beta.true |
true value for β. |
alpha.true |
true value for α. |
kappa.true |
true value for κ. |
sigmaV.true |
true value for σ_V. Required only when generating clustered data. |
cens |
a vector with two numeric elements. The right censoring times are generated from Uniform(cens[1], cens[2]). |
simSurv
returns a data.frame containing univariate time-to-event outcomes from n
subjects.
It is of dimension n\times 2: the columns correspond to y, δ.
y |
a vector of |
delta |
a vector of |
Kyu Ha Lee and Sebastien Haneuse
Maintainer: Kyu Ha Lee <klee15239@gmail.com>
set.seed(123456) J = 110 nj = 50 n = J * nj id <- rep(1:J, each = nj) x = matrix(0, n, 2) x[,1] = rnorm(n, 0, 2) x[,2] = sample(c(0, 1), n, replace = TRUE) beta.true = c(0.5, 0.5) alpha.true = 1.5 kappa.true = 0.02 sigmaV.true = 0.1 cens <- c(30, 40) simData <- simSurv(id, x, beta.true, alpha.true, kappa.true, sigmaV.true, cens)