stir: Stir your brew

Description Usage Arguments Value Examples

View source: R/stir.R

Description

After setting your primary and secondary imputation parameters (i.e., running spice and mash), you're ready to fit the imputation model(s) that will impute missing values in your training data. This is what the stir function does.

Usage

1
stir(brew, timer = FALSE)

Arguments

brew

an ipa_brew object.

timer

a logical value. If TRUE, then the amount of time it takes to fit the imputation models will be tracked and saved as an attribute of the resulting ipa_brew object.

Value

an ipa_brew object with imputed values added to the wort

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
x1 = rnorm(100)
x2 = rnorm(100) + x1
x3 = rnorm(100) + x1 + x2

outcome = 0.5 * (x1 - x2 + x3)

n_miss = 10
x1[1:n_miss] <- NA

data <- data.frame(x1=x1, x2=x2, x3=x3, outcome=outcome)

sft_brew <- brew_soft(data, outcome=outcome, bind_miss = FALSE)
sft_brew <- mash(sft_brew, with = masher_soft(bs = TRUE))
sft_brew <- stir(sft_brew, timer = TRUE)
sft_brew

bcjaeger/midy documentation built on May 3, 2020, 3:55 p.m.