simSurv {SemiCompRisks} | R Documentation |
The function that simulates independent/cluster-correlated right-censored survival data under Weibull/Weibull-Normal model.
Description
The function to simulate independent/cluster-correlated right-censored survival data under Weibull/Weibull-Normal model.
Usage
simSurv(id=NULL, x, beta.true, alpha.true, kappa.true, sigmaV.true=NULL, cens)
Arguments
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 |
cens |
a vector with two numeric elements. The right censoring times are generated from Uniform( |
Value
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
, \delta
.
y |
a vector of |
delta |
a vector of |
Author(s)
Kyu Ha Lee and Sebastien Haneuse
Maintainer: Kyu Ha Lee <klee15239@gmail.com>
Examples
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)