Runs Monte Carlo simulations using the bias-corrected crosswise model and creates a caterpillar plot showing sorted point estimates with bootstrap confidence intervals, replicating Panel C of Figure C7 in Atsusaka and Stevenson (2023).

sim_estimates(
  N.sim = 100,
  sample,
  prevalence,
  p,
  p.prime,
  gamma,
  direct,
  txcol = "dimgray",
  sim.results = NULL,
  verbose = TRUE
)

sim.estimates(...)

Arguments

N.sim

Integer. Number of Monte Carlo simulations. Default is 100.

sample

Integer. Sample size per simulation.

prevalence

Numeric. True prevalence rate of the sensitive attribute.

p

Numeric. Randomization probability for the sensitive question.

p.prime

Numeric. Randomization probability for the anchor question.

gamma

Numeric. Proportion of attentive respondents (between 0 and 1).

direct

Numeric. Direct questioning estimate for comparison.

txcol

Character. Color for annotation text. Default: "dimgray".

sim.results

Optional list. Pre-computed output from sim_cwdata. If NULL (default), the simulation is run internally.

verbose

Logical. Passed to sim_cwdata() when a new simulation is needed. If TRUE (the default), a progress bar is displayed.

...

Arguments passed to sim_estimates().

Value

Invisibly returns the simulation results list from sim_cwdata, containing BiasCorrectEst, BiasCorrectLow, BiasCorrectHigh, and summary Results.

Details

The plot displays:

  • Sorted bias-corrected point estimates as filled circles

  • Bootstrap 95% confidence intervals as vertical line segments

  • A horizontal reference line at 0

  • A horizontal reference line at the true prevalence prevalence (red)

Estimates are sorted in ascending order, creating a characteristic "fan" shape that reveals the distribution of estimates across simulations.

Text annotation positions are calibrated to N.sim = 100 and scale proportionally for other values.

If sim.results is supplied, all simulation parameters (N.sim, sample, p, p.prime, gamma, direct) are still used for the annotations, but no new simulation is run.

References

Atsusaka and Stevenson (2023). Figure C7, Panel C. doi:10.1017/pan.2021.43 .

See also

sim_cwdata for the underlying simulation function

Examples

if (FALSE) { # \dontrun{
# Replicate Panel C of Figure C7
sim_estimates(
  N.sim   = 100,
  sample  = 1000,
  prevalence = 0.1,
  p       = 0.1,
  p.prime = 0.1,
  gamma   = 0.8,
  direct  = 0.1
)

# Re-use pre-computed simulation results
res <- sim_cwdata(N.sim = 100, sample = 1000, prevalence = 0.1,
                  p = 0.1, p.prime = 0.1, gamma = 0.8, direct = 0.1)
sim_estimates(sample = 1000, prevalence = 0.1, p = 0.1, p.prime = 0.1,
              gamma = 0.8, direct = 0.1, sim.results = res)
} # }