imputeDiagnostics: Imputation Diagnostics

View source: R/imputeDiagnostics.R

imputeDiagnosticsR Documentation

Imputation Diagnostics

Description

Performs multivariate imputation by chained equations and returns a set of diagnostic plots and statistics together with the imputations.

Usage

imputeDiagnostics(x = NULL, nSim = 10, transConst = 0.01, ...)

Arguments

x

list of class niInput.

nSim

integer, number of imputations, default is 10.

transConst

numeric scalar, 0<transConst<=0.1. Transformation constant in log-transformation. Default is 0.01.

...

further arguments passed on to mice::mice.

Details

imputeDiagnostics is essentially the same function as imputeData, but returns in addition the complete output from mice::mice as well as a series of diagnostic plots.

imputeData will generally involve lengthy calculations where the nSim argument is set equal to the number of bootstrap samples in subsequent calculation of an index using calculateIndex.

imputeDiagnostics is intended to be run before imputeData, allowing inspection of the diagnostics using a low value for nSim, and thus facilitating trial runs with different settings of input arguments to mice::mice.

Value

A list of three elements:
identifiers: a data.frame with variables relating each imputed indicator observation to a missing observation in the data set x.
imp: list with 21 elements containing the complete output from mice::mice.
diagnostics: list of diagnostic outputs including convergence plots, stripplots showing the distribution of imputed and observed values, and plots showing the distribution of missing values over years and indicators.

Author(s)

Bård Pedersen

See Also

imputeData and mice::mice.
The vignette objectsInNIcalc gives a detailed description of niInput lists.

Examples

## Not run: 
imputeDiagnostics(x = themeData,
                 nSim = 10,
                 maxit = 100)$diagnostics

## End(Not run)


NINAnor/NIcalc documentation built on Oct. 26, 2023, 9:37 a.m.