mice.impute.2l.pmm: Two-level predictive mean matching

mice.impute.2l.pmmR Documentation

Two-level predictive mean matching

Description

The function imputes an incomplete variable based on a normal linear mixed effects model. The model is estimated using function glmmPQL() from package MASS. Matching is done by .pmm.match from package mice.

Usage

mice.impute.2l.pmm(y, ry, x, type, intercept = TRUE, donors = 5,
  wy = NULL, ...)

Arguments

y

Numeric vector with incomplete data

ry

Response pattern of y (TRUE=observed, FALSE=missing)

x

matrix with length(y) rows containing complete covariates

type

vector of length ncol(x) determining the imputation model; type is automatically extracted from the predictorMatrix argument of mice().

intercept

Logical. shall the intercept be included as a fixed and random effect?. TRUE = yes; FALSE = fixed effect only.

donors

The size of the donor pool; default is 5.

wy

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

...

additional arguments passed down from the main mice call

Details

Model specification / allowed entries in mice's predictorMatrix:

  • 0 = variable not included in imputation model

  • 1 = fixed effect

  • 2 = fixex and random effect

  • -2 = class variable

Value

vector with imputations

Author(s)

Kristian Kleinke

References

  • Kleinke, K. (2016, September). Multiple Imputation of Multilevel Data by "Two-Level Predictive Mean Matching". Paper presented at the 50th Congress of the German Psychological Society (DGPs), Leipzig, Germany.


kkleinke/countimp documentation built on Nov. 5, 2024, 11:51 a.m.