list_conditions_estimate | R Documentation |
This function wraps around list_conditions
to expand all
combinations of the arguments passed to the function. The arguments can
then be passed to purrr::pmap
(map2
) to iterate
over all simulation conditions.
list_conditions_estimate( .dat, .model_formula = lapply(list(NULL, "x_predictor", "z_composite", c("x_predictor", "z_composite")), function(v) write_formula(predictor_var = v)), .outcome_dist = "Normal", .mcmc_burn = 500, .mcmc_iter = 5000, .mcmc_nchains = 1, .mm_list = list(HLM = NA, MMREM = build_mm_list(.n_clust = 2)) )
.dat |
A dataframe produced by |
.model_formula |
A formula object. |
.outcome_dist |
A string. Defaults to "Normal". See the |
.mcmc_burn |
Numeric. Defaults to 100. |
.mcmc_iter |
Numeric. Defaults to 1000. |
.mcmc_nchains |
Numeric. Defaults to 1. |
.mm_list |
A list. Generated by |
NOTE: All arguments that take objects with length > 1 must
wrap those objects in a list.
Bad: list_conditions_datagen(.clust_cov = c(0.8, 0))
.
Good: list_conditions_datagen(.clust_cov = list(c(0.8, 0)))
.
Bad: list_conditions_estimate(.dat = generate_data())
.
Good: list_conditions_estimate(.dat = list(generate_data()))
.
The same applies to the .model_formula
and .mm_list
args,
even when only "one" condition is present. (That is, a single formula
with both a LHS and a RHS has length 3: "~", "LHS" and "RHS"; similarly,
for one multiple membership condition, build_mm_list
produces a list with length 2).
This function returns a list of all combinations of arguments passed to this function. Each list element is an argument with length equal to the number of combinations.
## Not run: list_conditions_estimate() ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.