MyNixOS website logo
Description

Data and Statistical Analyses after Multiple Imputation.

Statistical Analyses and Pooling after Multiple Imputation. A large variety of repeated statistical analysis can be performed and finally pooled. Statistical analysis that are available are, among others, Levene's test, Odds and Risk Ratios, One sample proportions, difference between proportions and linear and logistic regression models. Functions can also be used in combination with the Pipe operator. More and more statistical analyses and pooling functions will be added over time. Heymans (2007) <doi:10.1186/1471-2288-7-33>. Eekhout (2017) <doi:10.1186/s12874-017-0404-7>. Wiel (2009) <doi:10.1093/biostatistics/kxp011>. Marshall (2009) <doi:10.1186/1471-2288-9-57>. Sidi (2021) <doi:10.1080/00031305.2021.1898468>. Lott (2018) <doi:10.1080/00031305.2018.1473796>. Grund (2021) <doi:10.31234/osf.io/d459g>.

CRAN_Release_Badge R-CMD-check Total downloadsbadge

miceafter

With the miceafter package you can apply statistical and pooled analyses after multiple imputation. Therefore the name ‘miceafter’. The package contains a variety of statistical tests like the pool_levenetest function to pool Levene’s tests across multiply imputed datasets or the pool_propdiff_nw function to pool the difference between proportions according to method Newcombe-Wilson. The package also contains a function pool_glm to pool and select linear and logistic regression functions. Functions can also be used in combination with the %>% (Pipe) operator.

More and more statistical analyses and pooling functions will be added over time to form a framework of statistical tests that can be applied and pooled across multiply imputed datasets.

Examples

Pooling Levene’s Test

This example shows you how to pool the Levene test across 5 multiply imputed datasets. The pooling method that is used is method D1.

library(miceafter)

# Step 1: Turn data frame with multiply imputed datasets into object of 'milist'
imp_dat <- df2milist(lbpmilr, impvar="Impnr")

# Step 2: Do repeated analyses across multiply imputed datasets
ra <- with(imp_dat, expr=levene_test(Pain ~ factor(Carrying)))

# Step 3: Pool repeated test results
res <- pool_levenetest(ra, method="D1")
res
#>       F_value df1      df2    P(>F)       RIV
#> [1,] 1.586703   2 115.3418 0.209032 0.1809493
#> attr(,"class")
#> [1] "mipool"

Pooling Levene’s Test in one Pipe

library(miceafter)
library(magrittr)

lbpmilr %>%
  df2milist(impvar="Impnr") %>%
     with(expr=levene_test(Pain ~ factor(Carrying))) %>%
                                pool_levenetest(method="D1")
#>       F_value df1      df2    P(>F)       RIV
#> [1,] 1.586703   2 115.3418 0.209032 0.1809493
#> attr(,"class")
#> [1] "mipool"

Pooling Difference between Proportions according to Newcombe-Wilson

library(miceafter)

# Step 1: Turn data frame with multiply imputed datasets into object of 'milist'
imp_dat <- df2milist(lbpmilr, impvar="Impnr")

# Step 2: Do repeated analyses across multiply imputed datasets
ra <- with(imp_dat, 
           expr=propdiff_wald(Chronic ~ Radiation, strata = TRUE))

# Step 3: Pool repeated test results
res <- pool_propdiff_nw(ra)
res
#>      Prop diff CI L NW CI U NW
#> [1,]    0.2786  0.1199   0.419
#> attr(,"class")
#> [1] "mipool"

See for more functions the package website

Main functions

The main functions of the package are the df2milist, list2milist, mids2milist and the with.milist functions. The df2milist function turns a data frame with multiply imputed datasets into an object of class milist, the list2milist does this for a list with multiply imputed datasets and the mids2milist for objects of class mids. These milist object can than be used with the with.milist function to apply repeated statistical analyses across the multiply imputed datasets. Subsequently, pooling functions are available in the form of separate pool functions.

Installation

You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("mwheymans/miceafter")

Citation

Cite the package as:

Martijn W Heymans (2021). miceafter: Data Analysis and Pooling after Multiple Imputation. 
R package version 0.1.0. https://mwheymans.github.io/miceafter/
Metadata

Version

0.5.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows