Learn R Programming

optconerrf (version 1.0.1)

getSimulationResults: Simulate trials

Description

Simulate the rejection probability for a given design and alternative.

Usage

getSimulationResults(
  design,
  maxNumberOfIterations = 10000,
  alternative,
  seed = NULL
)

Value

An object of class SimulationResultsOptimalConditionalError containing the simulation results.

Arguments

design

An object of class TrialDesignOptimalConditionalError created by getDesignOptimalConditionalErrorFunction(). Contains all necessary arguments to calculate the optimal conditional error function for the specified case.

maxNumberOfIterations

Number of trials to be simulated.

alternative

Assumed relative effect size.

seed

An optional seed for reproducibility.

Details

Simulates the probabilities of overall rejection as well as early futility and early efficacy for the provided scenario and design. This is done by generating random normally distributed test statistics and calculating their p-values.

See Also

getDesignOptimalConditionalErrorFunction(), getOverallPower()

Examples

Run this code
# \donttest{
design <- getDesignOptimalConditionalErrorFunction(
 alpha = 0.025, alpha1 = 0.001, alpha0 = 0.5, delta1 = 0.25,
 useInterimEstimate = FALSE,
 conditionalPower = 0.9, likelihoodRatioDistribution = "maxlr",
 firstStageInformation = 10
)

# Simulate under the null hypothesis and for a mean difference of 0.5
getSimulationResults(
 design = design, alternative = c(0, 0.5)
)

# }

Run the code above in your browser using DataLab