mcs: The 'mcs()' helper function combines the 3-steps: simulate,...

View source: R/mcs.R

mcsR Documentation

The 'mcs()' helper function combines the 3-steps: simulate, calibrate, combine

Description

The 'mcs()' helper function combines the 3-steps: simulate, calibrate, combine

Usage

mcs(des_2be_cal, df_or_list_est_tot, form_outcome, form_poststrat, type_cal,
  num_sim = 1, parallel = FALSE, num_core = 1, lgl_rej_neg_sim = TRUE)

Arguments

des_2be_cal

a survey design object that is to be calibrated see design

df_or_list_est_tot

a single data.frame of estimated joint totals or list of data.frames of estimated marginal totals (and respective standard errors) see sim_tot_from_est

form_outcome

a formula of the outcome, whose total we want an improved MCS estimate of see cal_2_sim

form_poststrat

single formula of joint poststrata or list of formulas for marginal poststrata see cal_2_sim

type_cal

a character string for 'mcsp' or 'mcsr'

num_sim

the number of simulations to calibrate onto

parallel

a logical whether to run in parallel using parLapply

num_core

the number of cores for the parallel job

lgl_rej_neg_sim

a logical whether to reject negative simulations

Value

a 1 row data.frame of the MCS estimate and its standard error


statsccpr/MultCal2Sim documentation built on Sept. 3, 2022, 12:39 p.m.