View source: R/check_balance.R
check_balance | R Documentation |
Function compares totals for auxiliary variables specified in the x
argument for an object
that
contains either IPW or DR estimator.
check_balance(x, object, dig)
x |
formula specifying variables to check |
object |
object of |
dig |
number of digits for rounding (default = 2) |
A list
containing totals for non-probability and probability samples and their differences
data(admin)
data(jvs)
jvs_svy <- svydesign(ids = ~ 1, weights = ~ weight,
strata = ~ size + nace + region, data = jvs)
ipw_est1 <- nonprob(selection = ~ region + private + nace + size,
target = ~ single_shift,
svydesign = jvs_svy,
data = admin, method_selection = "logit"
)
ipw_est2 <- nonprob(
selection = ~ region + private + nace + size,
target = ~ single_shift,
svydesign = jvs_svy,
data = admin, method_selection = "logit",
control_selection = control_sel(est_method = "gee", gee_h_fun = 1))
## check the balance for the standard IPW
check_balance(~size, ipw_est1)
## check the balance for the calibrated IPW
check_balance(~size, ipw_est2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.