list_conditions_estimate: list_conditions_estimate

list_conditions_estimateR Documentation

list_conditions_estimate

Description

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.

Usage

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))
)

Arguments

.dat

A dataframe produced by generate_data.

.model_formula

A formula object.

.outcome_dist

A string. Defaults to "Normal". See the D argument in runMLwiN.

.mcmc_burn

Numeric. Defaults to 100.

.mcmc_iter

Numeric. Defaults to 1000.

.mcmc_nchains

Numeric. Defaults to 1.

.mm_list

A list. Generated by build_mm_list.

Details

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).

Value

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.

Examples

## Not run: 

list_conditions_estimate()


## End(Not run)

tessaleejohnson/corclus documentation built on Oct. 11, 2022, 3:46 a.m.