Skip to contents

A simple simulation helper that mimics an RDD/quota process: each wave, draw a simple random sample from remaining units and keep observed respondents up to per-stratum quotas proportional to population shares.

Usage

rdd_like(
  pop,
  strata,
  outcome,
  init = 200,
  wave = 150,
  budget = 800,
  quota_buffer = 0.2
)

Arguments

pop

data.frame Population with at least an id column, the strata columns, and optionally pi_true (ground-truth response propensity in (0,1)).

strata

character() Names of columns forming the stratum label.

outcome

character(1) Name of binary outcome column.

init

integer Initial wave sample size.

wave

integer Subsequent wave sample size.

budget

integer Total target respondents; stop once reached (or cap at 20 waves).

quota_buffer

numeric Non-negative buffer to inflate per-stratum quotas.

Value

A list with:

  • summary: data.frame with wave-level summary (n_respondents, estimate, error)

  • final_sample: data.frame of respondent ids

Details

This is intended for vignette use and quick comparisons; it's not a full reproduction of any specific RDD implementation.