simulateScenarios {bhmbasket}R Documentation

simulateScenarios

Description

This function creates scenarios for the analysis with performAnalyses.

Usage

simulateScenarios(
  n_subjects_list,
  response_rates_list,
  scenario_numbers = seq_along(response_rates_list),
  n_trials = 10000
)

Arguments

n_subjects_list

A list that contains for each scenario a vector for the number of subjects per cohort. A single vector can be provided if all scenarios should have the same number of subjects.

response_rates_list

A list that contains for each scenario a vector for the response rates per cohort.

scenario_numbers

A vector of positive integers naming the scenarios, Default: seq_along(response_rates_list)

n_trials

An integer indicating the number of trial simulations per response rates, Default: 10000. If n_trials is present in .GlobalEnv and missing(n_trials), the globally available value will be used.

Details

The function simulates trials with binary outcome for each scenario. Integer values for the response rates will be treated as observed outcomes.

Value

An object of class scenario_list with the scenario data for each specified scenario.

Author(s)

Stephan Wojciekowski

See Also

saveScenarios createTrial performAnalyses

Examples

  n_subjects     <- c(10, 20, 30)

  rr_negative    <- rep(0.1, 3)
  rr_nugget      <- c(0.9, 0.1, 0.1)
  rr_positive    <- rep(0.9, 3)

  scenarios_list <- simulateScenarios(
    n_subjects_list     = list(n_subjects,
                               n_subjects,
                               n_subjects),
    response_rates_list = list(rr_negative,
                               rr_nugget,
                               rr_positive))

[Package bhmbasket version 0.9.5 Index]