compute_ess_from_raw: Compute effective sample size from raw simulation output

View source: R/simulation.R

compute_ess_from_rawR Documentation

Compute effective sample size from raw simulation output

Description

Computes a variance-ratio effective sample size for each method relative to a reference method (typically internal-only), based on the Monte Carlo variance of the treatment effect estimator across replicates: ESS_m = NS \cdot (Var_{ref} / Var_m - 1).

Usage

compute_ess_from_raw(
  raw_df,
  NS,
  ref_method = "InternalOnly",
  methods_exclude = NULL
)

Arguments

raw_df

A data frame with at least method and theta_hat columns.

NS

Reference sample-size scale. The study wrappers use the total internal randomized sample size, nI1 + nI0.

ref_method

Name of the reference method (default "InternalOnly").

methods_exclude

Optional character vector of methods to exclude from the output.

Value

A data frame with method and ESS columns. ESS is a variance-equivalent gain, can be negative, and does not measure bias.

Examples


sim_out <- run_simulation(nsim = 2, scenario = scenario_S1,
                          lambdas = lambdas_default, alpha = 0.025, seed = 1)
compute_ess_from_raw(sim_out$raw, NS = 300)


fdb documentation built on Oct. 4, 2026, 5:07 p.m.