Skip to contents

Generate simulated data for unanchored comparisons matching the design from the ML-UMR abstract: two single-arm studies with correlated prognostic factors and binary outcomes.

Usage

generate_simulation_data(
  n_index = 200,
  n_comparator = 150,
  n_covariates = 2,
  effect_modification = c("none", "moderate", "strong"),
  population_shift = 0.5,
  correlation = 0.3,
  likelihood = c("binomial", "normal", "poisson"),
  agd_type = c("summary", "subgroups"),
  seed = NULL
)

Arguments

n_index

Sample size for index treatment (IPD)

n_comparator

Sample size for comparator treatment (AgD)

n_covariates

Number of prognostic factors

effect_modification

Degree of effect modification: "none" (SPFA holds), "moderate", or "strong"

population_shift

Mean difference in covariates between populations

correlation

Correlation between covariates

likelihood

Outcome type: "binomial" (default), "normal", or "poisson"

agd_type

Type of AgD output: "summary" (single summary row) or "subgroups" (multiple subgroups based on covariate median splits). Default "summary".

seed

Random seed for reproducibility

Value

A list with components:

ipd

Data frame with IPD

agd

Data frame with AgD summaries

truth

List of true parameter values

Examples

if (FALSE) { # \dontrun{
# SPFA scenario (no effect modification)
data_spfa <- generate_simulation_data(
  n_index = 200,
  n_comparator = 150,
  n_covariates = 2,
  effect_modification = "none",
  seed = 123
)

# Strong effect modification
data_em <- generate_simulation_data(
  n_index = 200,
  n_comparator = 150,
  n_covariates = 2,
  effect_modification = "strong",
  seed = 456
)
} # }