ggmice icon indicating copy to clipboard operation
ggmice copied to clipboard

Add `facets` or `purrr::map()` to old friends to plot all variables

Open hanneoberman opened this issue 1 year ago • 4 comments

This is still an advantage of mice::stripplot(imp) over the ggmice solution

hanneoberman avatar Mar 15 '23 11:03 hanneoberman

e.g. in vignettes/ggmice.Rmd on line 163

hanneoberman avatar Jun 01 '23 13:06 hanneoberman

add facet example using patchwork for each example.

pepijnvink avatar Jun 27 '23 12:06 pepijnvink

Fixed in #101

hanneoberman avatar Jul 21 '23 11:07 hanneoberman

Think about adding a wrapper function for the old friends...

library(ggmice)
imp <- mice::mice(mice::nhanes, print = FALSE)
purrr::map(names(imp$data), ~{
    # ggmice equivalent
    ggmice(imp, ggplot2::aes(x = .imp, y = .data[[.x]])) +
        ggplot2::geom_jitter(height = 0, width = 0.25) +
        ggplot2::labs(x = "Imputation number") 
}) %>% setNames(names(imp$data))
#> $age

#> 
#> $bmi

#> 
#> $hyp

#> 
#> $chl

Created on 2023-11-07 with reprex v2.0.2

hanneoberman avatar Nov 07 '23 09:11 hanneoberman