Description Usage Arguments Details Value Author(s) Examples
simul.int
simulates survival data with exponentially distributed survival times where interactions are included. The interactions are generated by variables without effect.
1 2 3 4 5 6 7 | simul.int(seed, n = 100, p = 1000,
n.main = 2,
n.int = 2,
beta.main=2,
beta.int = 4,
censparam = 1/5,
lambda = 1/20)
|
seed |
seed for random number generator. |
n |
number of individuals in the data set. |
p |
number of covariates in the data set. |
n.main |
number of main effects with effects. |
n.int |
number of interactions with effects. |
beta.main |
effect size of main effects. |
beta.int |
effect size of interaction effects. |
censparam |
value for censoring Parameter. |
lambda |
value for baseline hazard. |
The function simul.int
creates exponentially distributed survival times with baseline hazard lambda
.
The number of covariates is p
and the sample size is n
.
All covariates are standard normal distributed.
The first n.main
columns correspond to the main effects and the following n.int
columns correspond to the interactions. The effect sizes of the main effects are in absolute value beta.main
, whereupon the first floor(n.main/2)
variables have positive effect sizes and the rest of the main effects have effect size -beta.main
.
The effect sizes of the interactions are in absolute value beta.inter
, where half of them are positive and half of them are negative like for the main effects.
simul.int
returns the simulated data set and the information about the effect sizes:
data |
simulated dataset with p+2 columns and n rows. The last two columns consist of exponentially distributed survival time ( |
info |
information about the effect sizes of the main effects and of the included interactions. |
Written by Isabell Hoffmann isabell.hoffmann@uni-mainz.de.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # Create survival data with interactions:
simul <- simul.int(287578,n = 200, p = 1000,
beta.int = 1.0,
beta.main = 0.9,
censparam = 1/20,
lambda = 1/20)
#Show the effect sizes of the main effects and interactions of the simulated data set:
simul$info
# Extract the data set:
data <- simul$data
# Plot the Kaplan Meier:
simul.fit <- survfit(Surv(obs.time,obs.status) ~ 1, data = data)
plot(simul.fit)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.