interimTrial: 'interimTrial' simulates one survival study with interim...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/interim_and_survival_package_functions.R

Description

interimTrial comes in two variants: When standalone is 'TRUE' the result is nicely formatted and can be used with the plotting functions plotinterimFDR, plotinterimAPR, and plotinterimStops. When standalone is 'FALSE' the result is presented as one single vector, which makes it usable within interimTrialSimulation.

Usage

1
2
  interimTrial(patdat, gendat, l.2, M.1, M.2, alpha,
    powerThreshold, adjustment, standalone = TRUE)

Arguments

patdat

the patient data (arrival times and survival times) as generated by generatePatientData

gendat

the gene expression data as generated by generateExpressionData

l.2

the length of the follow-up period to be simulated

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")

standalone

boolean parameter that controls whether it is used within a bigger simulation. Defaults to 'TRUE'

Details

The adjustment parameter is used as parameter to p.adjust.

The parameters patdat and gendat are of type list and do not necessarily have to be obtained from the functions generatePatientData and generateExpressionData. Especially the entries N.1 and N.2 in patdat can be changed. But in this case make sure to generate gendat accordingly.

Internally interimTrial performs a gene-wise Cox-regression to determin the survival correlated genes.

Value

In case the function is used in standalone mode:

resultTable

the only real result. This table holds the error and power rates that came from the simulation. The fist row additionally shows at which analysis the simulated survival study was stopped.

The other values are copied versions of the corresponding input parameters. They are included into the result for convenience only.

In case the function is not used in standalone mode: The return value is one vector containing the elements of resultTable.

Author(s)

Andreas Leha andreas.leha@med.uni-goettingen.de

See Also

generatePatientData and generateExpressionData to generate the input data

plotinterimFDR, plotinterimAPR, and plotinterimStops to visualize the results

interimTrialSimulation for a wrapper that simulates not one but many survival studies (and calls this function)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
N <- 50
l.1.tick <- 60
lambda <- 60

patdat <- generatePatientData(N, l.1.tick, lambda)

fc <- c(rep(0, 500), ceiling(rnorm(500, 0, 1)-0.5))
Sigma.1 <- diag(1000)
Sigma.2 <- diag(1000)
N.1 <- patdat$N.1
N.2 <- patdat$N.2

gendat <- generateExpressionData(fc, Sigma.1, Sigma.2, N.1, N.2)

l.2 <- 60
M.1 <- 2
M.2 <- 2
alpha <- 0.05
powerThreshold <- 0.8
adjustment <- "BH"

## Not run: T <- interimTrial(patdat, gendat, l.2, M.1, M.2, alpha, powerThreshold, adjustment)

survGenesInterim documentation built on May 2, 2019, 5:22 p.m.