mice.impute.2l.zinb: Multiple Imputation of Zero-Inflated Two-Level Count Data

mice.impute.2l.zinbR Documentation

Multiple Imputation of Zero-Inflated Two-Level Count Data

Description

The functions impute zero-inflated multilevel count data based on a two-level Poisson or negative binomial zero-inflation 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. It may be specified, if the intercept is excluded from the random part of the zero model (“.noint.zero”), the count model (“.noint.count”), or both models (“.noint.both”). Zero-inflation models are mixture models and consist of two model components: the zero model (a binomial generalized linear mixed effects model), determining, if the observational unit belongs to zero-inflation process (certain zeros) or to the count process, and the count model (a two-level Poisson or NB model), determining, what count (zero or non-zero) the observational unit has.

Usage

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

mice.impute.2l.zip.noint.zero(y, ry, x, type, intercept.c = TRUE,
  intercept.z = 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.c

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

intercept.z

TRUE: model will include intercept as a random effect in the zero model; FALSE: zero model 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 (zero and count model)

  • 2 = variable will be included as a fixed and random effect (zero and count model)

  • 3 = variable will be included as a fixed effect (count model only)

  • 4 = variable will be included as a fixed and random effect (count model only)

  • 5 = variable will be included as a fixed effect (zero model only)

  • 6 = variable will be included as a fixed and random effect (zero model only)

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

  1. Fit the zero model (a two-level binomial generalized linear mixed effects model), using the glmmTMB function from package glmmTMB; find bhat, the posterior mean, and V(bhat), the posterior variance of model parameters b

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

  3. Compute predicted probabilities for having a zero vs. non-zero count

  4. Draw imputations (zeros and ones) from a binomial distribution with the respective individual probabilities obtained from step 3.

  5. Fit the count model (a two-level Poisson or NB model) using the glmmTMB function from package glmmTMB; find bhat, the posterior mean, and V(bhat), the posterior variance of model parameters b.

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

  7. Compute predicted values using parameters b* and replace non-zero imputations (from step 4) by a draw from a zero-truncated NB distribution with mean parameter mu being the count predicted for the respective incomplete case.

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 zero model to the bootstrap sample

  2. Compute predicted probabilities for having a zero vs. non-zero count

  3. Draw imputations from a binomial distribution.

  4. Fit the count model to the boostrap sample

  5. Compute predicted counts and draw non-zero imputations (from step 3) from a zero-truncated Poisson or NB distribution.

Value

Numeric vector of length sum(!ry) with imputations

Functions

  • mice.impute.2l.zinb: Bayesian regression variant; random intercepts

  • mice.impute.2l.zinb.boot: bootstrap regression variant; random intercepts

  • mice.impute.2l.zinb.noint.both.boot: bootstrap regression variant; fixed intercepts

  • mice.impute.2l.zinb.noint.both: Bayesian regression variant; fixed intercepts

  • mice.impute.2l.zinb.noint.count.boot: bootstrap regression variant; fixed intercept in count model

  • mice.impute.2l.zinb.noint.count: Bayesian regression variant; fixed intercept in count model

  • mice.impute.2l.zinb.noint.zero.boot: bootstrap regression variant; fixed interceot in zero model

  • mice.impute.2l.zinb.noint.zero: Bayesian regression variant; fixed intercept in zero model

  • mice.impute.2l.zip: Bayesian regression variant; random intercepts

  • mice.impute.2l.zip.boot: bootstrap regression variant; random intercepts

  • mice.impute.2l.zip.noint.both.boot: bootstrap regression variant; fixed intercepts

  • mice.impute.2l.zip.noint.both: Bayesian regression variant; fixed intercepts

  • mice.impute.2l.zip.noint.count.boot: bootstrap regression variant; fixed intercept in count model

  • mice.impute.2l.zip.noint.count: Bayesian regression variant; fixed intercept in count model

  • mice.impute.2l.zip.noint.zero.boot: bootstrap regression variant; fixed interceot in zero model

  • mice.impute.2l.zip.noint.zero: Bayesian regression variant; fixed intercept in zero model

Author(s)

Kristian Kleinke


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