Skip to content

including more general formulas in irmi #33

@matthias-da

Description

@matthias-da

currently, in irmi only simple formulas for each variable can be specified, such as

form=list(
  NonD  = c("BodyWgt", "BrainWgt"),
  Dream = c("BodyWgt", "BrainWgt"),
  Sleep = c("BrainWgt"),
  Span  = c("BodyWgt"),
  Gest  = c("BodyWgt", "BrainWgt")
)

However, it should also work for any formula specified (as long as the correct variable names are used).

library(VIM)
data(sleep)
form = list(
  "log(NonD)  ~ log(BodyWgt) + log(BrainWgt) + I(Sleep^2)",
  "Dream      ~ BodyWgt + BrainWgt:Danger",
  "log(Sleep) ~ BrainWgt * Danger + I(BrainWgt^2)",
  "Span       ~ ."
  "Gest       ~ sqrt(BodyWgt) + Span * Danger"
)
irmi(sleep, modelFormulas = form, trace = TRUE)

Only with this enhancement irmi can outperform other imputation methods and be efficiently used in practice for more complex data and statistical modelling purposes.

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions