Skip to contents

Runs Cartesian product of study options (e.g. sampling rules, lookback windows, wash-out days) and tabulates comparative N, events, and rates side by side.

Usage

run_study_grid(
  con,
  study_fn,
  variants,
  base_args = list(),
  outcome_col = "outcome",
  site_col = "site"
)

Arguments

con

Active DuckDB DBI connection.

study_fn

Function returning a cohort data frame given parameter arguments.

variants

Named list mapping parameter names to vectors of candidate values.

base_args

Named list of fixed base arguments.

outcome_col

Name of event/outcome indicator column (default 'outcome').

site_col

Site column name if present (default 'site').

Value

A data frame with variant parameters, site, total_n, event_count, event_rate.