Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

mice.impute.norm

Imputation by Bayesian linear regression


Description

Calculates imputations for univariate missing data by Bayesian linear regression, also known as the normal model.

Usage

mice.impute.norm(y, ry, x, wy = NULL, ...)

Arguments

y

Vector to be imputed

ry

Logical vector of length length(y) indicating the the subset y[ry] of elements in y to which the imputation model is fitted. The ry generally distinguishes the observed (TRUE) and missing values (FALSE) in y.

x

Numeric design matrix with length(y) rows with predictors for y. Matrix x may have no missing values.

wy

Logical vector of length length(y). A TRUE value indicates locations in y for which imputations are created.

...

Other named arguments.

Details

Imputation of y by the normal model by the method defined by Rubin (1987, p. 167). The procedure is as follows:

  1. Calculate the cross-product matrix S=X_{obs}'X_{obs}.

  2. Calculate V = (S+{diag}(S)κ)^{-1}, with some small ridge parameter κ.

  3. Calculate regression weights \hatβ = VX_{obs}'y_{obs}.

  4. Draw a random variable \dot g \sim χ^2_ν with ν=n_1 - q.

  5. Calculate \dotσ^2 = (y_{obs} - X_{obs}\hatβ)'(y_{obs} - X_{obs}\hatβ)/\dot g.

  6. Draw q independent N(0,1) variates in vector \dot z_1.

  7. Calculate V^{1/2} by Cholesky decomposition.

  8. Calculate \dotβ = \hatβ + \dotσ\dot z_1 V^{1/2}.

  9. Draw n_0 independent N(0,1) variates in vector \dot z_2.

  10. Calculate the n_0 values y_{imp} = X_{mis}\dotβ + \dot z_2\dotσ.

Using mice.impute.norm for all columns emulates Schafer's NORM method (Schafer, 1997).

Value

Vector with imputed data, same type as y, and of length sum(wy)

Author(s)

Stef van Buuren, Karin Groothuis-Oudshoorn

References

Rubin, D.B (1987). Multiple Imputation for Nonresponse in Surveys. New York: John Wiley & Sons.

Schafer, J.L. (1997). Analysis of incomplete multivariate data. London: Chapman & Hall.

See Also


mice

Multivariate Imputation by Chained Equations

v3.13.0
GPL-2 | GPL-3
Authors
Stef van Buuren [aut, cre], Karin Groothuis-Oudshoorn [aut], Gerko Vink [ctb], Rianne Schouten [ctb], Alexander Robitzsch [ctb], Patrick Rockenschaub [ctb], Lisa Doove [ctb], Shahab Jolani [ctb], Margarita Moreno-Betancur [ctb], Ian White [ctb], Philipp Gaffert [ctb], Florian Meinfelder [ctb], Bernie Gray [ctb], Vincent Arel-Bundock [ctb]
Initial release
2021-01-26

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.