Description Usage Arguments Value Author(s) Examples
The function to simulate independent/cluster-correlated semi-competing risks data under semi-Markov Weibull/Weibull-MVN models.
1 2 3 4 |
id |
a vector of cluster information for |
x1 |
covariate matrix, |
x2 |
covariate matrix, |
x3 |
covariate matrix, |
beta1.true |
true value for β_1. |
beta2.true |
true value for β_2. |
beta3.true |
true value for β_3. |
alpha1.true |
true value for α_1. |
alpha2.true |
true value for α_2. |
alpha3.true |
true value for α_3. |
kappa1.true |
true value for κ_1. |
kappa2.true |
true value for κ_2. |
kappa3.true |
true value for κ_3. |
theta.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]). |
simIDcor
returns a data.frame containing semi-competing risks outcomes from n
subjects.
It is of dimension n\times 4: the columns correspond to y_1, δ_1, y_2, δ_2.
y1 |
a vector of |
y2 |
a vector of |
delta1 |
a vector of |
delta2 |
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 23 24 25 26 27 28 29 30 31 32 33 | library(MASS)
set.seed(123456)
J = 110
nj = 50
n = J * nj
id <- rep(1:J, each = nj)
kappa1.true <- 0.05
kappa2.true <- 0.01
kappa3.true <- 0.01
alpha1.true <- 0.8
alpha2.true <- 1.1
alpha3.true <- 0.9
beta1.true <- c(0.5, 0.8, -0.5)
beta2.true <- c(0.5, 0.8, -0.5)
beta3.true <- c(1, 1, -1)
SigmaV.true <- matrix(0.25,3,3)
theta.true <- 0.5
cens <- c(90, 90)
cov1 <- matrix(rnorm((length(beta1.true)-1)*n, 0, 1), n, length(beta1.true)-1)
cov2 <- sample(c(0, 1), n, replace = TRUE)
x1 <- as.data.frame(cbind(cov1, cov2))
x2 <- as.data.frame(cbind(cov1, cov2))
x3 <- as.data.frame(cbind(cov1, cov2))
simData <- simID(id, x1, x2, x3, beta1.true, beta2.true, beta3.true,
alpha1.true, alpha2.true, alpha3.true,
kappa1.true, kappa2.true, kappa3.true,
theta.true, SigmaV.true, cens)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.