Description Usage Arguments Value Author(s) Examples
The function to simulate independent/cluster-correlated right-censored survival data under Weibull/Weibull-Normal model.
1 |
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>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.