Creates a structured set of conditions and argument lists for power analysis simulations. This function takes varying condition parameters and static parameters, validates them against the design requirements, and creates all necessary argument combinations for simulation runs.
Value
An S7 object of class "rctbp_conditions" containing:
- conditions_grid
A data.frame with all parameter combinations
- condition_arguments
A list of argument lists for each condition, separated into simulation and interim analysis arguments
- design
The original rctbp_design object
- condition_values
The original condition_values list
- static_values
The original static_values list
Details
The function performs several validation steps:
Checks that condition_values and static_values don't have overlapping names
Validates that all required parameters are provided
Ensures p_alloc is properly specified as a list
Creates expanded grid of all condition combinations
Examples
if (FALSE) { # \dontrun{
# Create conditions for sample size and effect size analysis
conditions <- build_conditions(
design = my_design,
condition_values = list(
n_total = c(100, 200, 300),
effect_size = c(0.2, 0.5, 0.8)
),
static_values = list(
p_alloc = list(c(0.5, 0.5)),
baseline_effect = 0.1
)
)
# Print the conditions
print(conditions)
} # }