Skip to contents

Simulate ACS estimates from published estimates and MOEs.

Usage

acs_simulate(
  estimates,
  moes,
  cov = NULL,
  n_sims = 1000,
  dist = c("normal", "censored_normal"),
  conf = 0.9
)

Arguments

estimates

Numeric estimates.

moes

Numeric MOEs corresponding to estimates.

cov

Optional covariance matrix on the standard-error scale.

n_sims

Number of Monte Carlo simulations.

dist

Distribution assumption: "normal" or "censored_normal". The censored variant replaces below-zero draws with zero, matching the convention used in Napierala & Denton (2017) for ACS counts.

conf

Confidence level associated with input MOEs.

Value

A numeric matrix of simulated draws.

Examples

set.seed(1)
acs_simulate(c(x = 100, y = 50), c(10, 5), n_sims = 5)
#>              x        y
#> [1,] 103.80857 52.49405
#> [2,]  98.88353 48.51832
#> [3,] 105.08026 47.75565
#> [4,]  90.30138 48.24975
#> [5,]  97.99673 50.92831