Description Usage Arguments Value Author(s) See Also Examples
View source: R/interim_and_survival_package_functions.R
interimTrialSimulation
performs several
simulations of survival studies based on the given
parameters. For each survial study simulation the
patient data (arrival times and survival times) and the
gene expression level data are newly generated.
1 2 3 | interimTrialSimulation(fc, Sigma.1, Sigma.2, N, l.1.tick,
l.2, lambda, M.1, M.2, alpha, powerThreshold,
adjustment, numSimRuns, parallel = TRUE)
|
fc |
the vector of foldchanges between the two groups |
Sigma.1 |
the covariance matrix describing the correlation between the genes in group one |
Sigma.2 |
the covariance matrix describing the correlation between the genes in group two. If this is NULL, the homoscedastic case is assumed and Sigma.2 is set to Sigma.1. |
N |
the sample size, i.e. the number of patients |
l.1.tick |
the (anticipated) lenth of the recruitment period |
l.2 |
the length of the follow-up period to be simulated |
lambda |
the mean survival time of the patients |
M.1 |
the number of analyses during the recruitment period to be simulated |
M.2 |
the number of analyses during the follow-up period to be simulated |
alpha |
the error level at which the FDR is to be controlled |
powerThreshold |
the study is stopped as soon as the estimated power rate exceeds this threshold |
adjustment |
the method to use for the p-value adjustment to account for multiple testing. In c("holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none") |
numSimRuns |
the number of survival studies to be simulated |
parallel |
boolean value specifying whether to use the package 'multicore' for a parallel execution of the simulation loop |
resultTable |
the only real result. This table holds the mean error and power rates from all the simulation runs. The first row additionally shows for each (interim) analysis the fraction of simulated survival studies that were stopped then. |
The other values are copied versions of the corresponding input parameters. They are included into the result for convenience only.
Andreas Leha andreas.leha@med.uni-goettingen.de
calls generatePatientData
and
generateExpressionData
to generate the data
and interimTrial
to simulate a single survival
study
plotinterimFDR
,
plotinterimAPR
, and
plotinterimStops
to visualize the results
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 | ## parameters controlling the gene level expression
fc <- c(rep(0, 500), ceiling(rnorm(500, 0, 1)-0.5))
Sigma.1 <- diag(1000)
Sigma.2 <- diag(1000)
## parameters controlling the patient data
N <- 50
l.1.tick <- 60
l.2 <- 60
lambda <- 60
## parameters controlling the study design
M.1 <- 2
M.2 <- 2
alpha <- 0.05
powerThreshold <- 0.8
adjustment <- "BH"
## the number of studies to simulate
numSimRuns <- 2
## Not run: result <- interimTrialSimulation(fc, Sigma.1, Sigma.2,
N, l.1.tick, l.2, lambda,
M.1, M.2, alpha, powerThreshold, adjustment,
numSimRuns, parallel=FALSE)
## End(Not run)
## Not run: result$resultTable
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.