compare_imp: Comparing imputations and original data distributions

Description Usage Arguments Value Examples

View source: R/plots.R

Description

ggplot2 visualization to support which imputation method to choose

Usage

1
compare_imp(df, origin, target)

Arguments

df

data.frame with origin variable and the new one with imputations

origin

character value - the name of origin variable with values before any imputations

target

character vector - names of variables with applied imputations

Value

ggplot2 object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
data(air_miss)
air_miss$Ozone_imp <- fill_NA(
    x = air_miss,
    model = "lm_bayes",
    posit_y = 1,
    posit_x = c(4, 6),
    logreg = TRUE
)
air_miss$Ozone_imp2 <- fill_NA_N(
    x = air_miss,
    model = "pmm",
    posit_y = 1,
    posit_x = c(4, 6),
    logreg = TRUE
)

compare_imp(air_miss, origin = "Ozone", "Ozone_imp")
compare_imp(air_miss, origin = "Ozone", c("Ozone_imp", 'Ozone_imp2'))

miceFast documentation built on July 11, 2021, 1:06 a.m.