make.formulas.saturated {micd}R Documentation

Creates a formulas Argument

Description

This helper function creates a valid formulas object. The formulas object is an argument to the mice::mice function. It is a list of formulas that specifies the target variables and the predictors by means of the standard ~ operator. In contrast to mice::make.formulas, which creates main effects formulas, make.formulas.saturated creates formulas including interaction effects.

Usage

make.formulas.saturated(
  data,
  blocks = mice::make.blocks(data),
  predictorMatrix = NULL,
  d = NULL
)

Arguments

data

A data.frame with the source data.

blocks

An optional specification for blocks of variables in the rows. The default assigns each variable in its own block.

predictorMatrix

A predictorMatrix specified by the user.

d

maximum depth of interactions to be considered (1=no interactions, 2=two-way interactions, etc.)

Value

A list of formulas.

Note

A modification of mice::make.formulas by Stef van Buuren et al.

See Also

mice::make.formulas

Examples

## main effects model:
data(nhanes)
f1 <- make.formulas(nhanes)
f1

## saturated model:
f2 <- make.formulas.saturated(nhanes)
f2


[Package micd version 1.1.1 Index]