mice.impute.2l.poisson: Multiple Imputation of Incomplete Two-Level Count Data

mice.impute.2l.poissonR Documentation

Multiple Imputation of Incomplete Two-Level Count Data

Description

The functions impute multilevel count data based on a two-level Poisson or negative binomial model, either using a Bayesian regression or a bootstrap regression approach (appendix: “.boot”). The .noint variants treat the intercept only as a fixed, but not as a random effect. Package glmmTMB is used to fit the model.

Usage

mice.impute.2l.poisson(y, ry, x, type, intercept = TRUE, wy = NULL,
  EV = TRUE)

mice.impute.2l.poisson.noint(y, ry, x, type, intercept = FALSE, wy = NULL,
  EV = TRUE)

mice.impute.2l.poisson.boot(y, ry, x, type, intercept = TRUE, wy = NULL,
  EV = TRUE)

mice.impute.2l.poisson.noint.boot(y, ry, x, type, intercept = FALSE,
  wy = NULL, EV = TRUE)

mice.impute.2l.nb(y, ry, x, type, intercept = TRUE, wy = NULL, EV = TRUE)

mice.impute.2l.nb.noint(y, ry, x, type, intercept = FALSE, wy = NULL,
  EV = TRUE)

mice.impute.2l.nb.boot(y, ry, x, type, intercept = TRUE, wy = NULL,
  EV = TRUE)

mice.impute.2l.nb.noint.boot(y, ry, x, type, intercept = FALSE, wy = NULL,
  EV = TRUE)

mice.impute.2l.nb2(y, ry, x, type, intercept = TRUE, wy = NULL, EV = TRUE)

mice.impute.2l.nb2.noint(y, ry, x, type, intercept = FALSE, wy = NULL,
  EV = TRUE)

mice.impute.2l.nb2.boot(y, ry, x, type, intercept = TRUE, wy = NULL,
  EV = TRUE)

mice.impute.2l.nb2.noint.boot(y, ry, x, type, intercept = FALSE, wy = NULL,
  EV = TRUE)

Arguments

y

Numeric vector with incomplete data in long format (i.e. the groups are stacked upon each other)

ry

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

x

matrix with length(y) rows containing complete covariates; also in long format

type

vector of length ncol(x) identifying fixed, random, and class variables; type is automatically extracted from the predictorMatrix; see mice's user's manual for details about how to specify the imputation model; see also section “details”.

intercept

TRUE: model will include intercept as a random effect; FALSE: intercept will be treated as fixed.

wy

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

EV

should automatic outlier handling of imputed values be enabled? Default is TRUE: extreme imputations will be identified. These values will be replaced by imputations obtained by predictive mean matching (function mice.impute.midastouch())

Details

Model specification details:

  • -2 = class variable (only one class variable is allowed!)

  • 0 = variable not included in imputation model

  • 1 = variable will be included as a fixed effect

  • 2 = variable will be included as a fixed and random effect

The Bayesian regression variants (see Rubin 1987, p. 169-170) consist of the following steps:

  1. Fit the model; find bhat, the posterior mean, and V(bhat), the posterior variance of model parameters b

  2. Draw b* from N(bhat,V(bhat))

  3. Obtain fitted values based on b*

  4. Draw imputations for the incomplete part from appropriate distribution (Poisson or NB)

The bootstrap functions draw a bootstrap sample from y[ry] and x[ry,] (Note: we resample clusters rather than individual cases) and consist of the following steps:

  1. Fit the model to the bootstrap sample

  2. Obtain fitted values

  3. Draw imputations for the incomplete part from appropriate distribution (Poisson or NB)

Value

Numeric vector of length sum(!ry) with imputations

Functions

  • mice.impute.2l.poisson: Bayesian Poisson regression variant; random intercept

  • mice.impute.2l.poisson.noint: Bayesian NB regression variant; fixed intercept

  • mice.impute.2l.poisson.boot: Bootstrap NB regression variant; random intercept

  • mice.impute.2l.poisson.noint.boot: Bootstrap NB regression variant; fixed intercept

  • mice.impute.2l.nb: Bayesian NB regression variant; random intercept

  • mice.impute.2l.nb.noint: Bayesian NB regression variant; fixed intercept

  • mice.impute.2l.nb.boot: Bootstrap NB regression variant; random intercept

  • mice.impute.2l.nb.noint.boot: Bootstrap NB regression variant; fixed intercept

  • mice.impute.2l.nb2: identical to mice.impute.2l.nb; kept for backward compatibility

  • mice.impute.2l.nb2.noint: identical to mice.impute.2l.nb.noint; kept for backward compatibility

  • mice.impute.2l.nb2.boot: identical to mice.impute.2l.nb.boot; kept for backward compatibility

  • mice.impute.2l.nb2.noint.boot: identical to mice.impute.2l.nb.noint.boot; kept for backward compatibility

Author(s)

Kristian Kleinke


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