I am using mice to multiply impute data on a dataset with many variables with missing values. I followed this vignette to do a sensitivity analysis to understand how the imputations are influenced by violations of the MAR assumption in one missing variable. However, I am using mice to impute more than one missing variable. This vignette uses the delta adjustment technique. I am currently using all variables (including the missing variables) that are included in final analysis as predictors in the predictor matrix to impute the dataset.

My question: Is it valid to adjust more than one variable at a time when imputing the dataset (ie, instead of setting the varying delta levels for one variable as described in the vignette, set the delta, eg. 10% of the mean of the raw data, for several variables at a time, and then impute the data)? Or do I have to perform sensitivity analysis for each imputed variable one at a time?

Following the vignette, and setting the delta for more than one variable at a time, one could come up with this approach:

  # perform a dry run 
  ini <- mice(data, maxit = 0)
  # obtain post processing matrix
  post <- ini$post

  # create the delta vector for each variable
  # set delta to 0, +10% and +20% of the raw mean value
  delta <- list()
  for (var in vars$missing) {
    d1 <- mean(data[[var]],na.rm=T) * 0.1
    d2 <- mean(data[[var]],na.rm=T) * 0.2
    delta[[var]] <- c(0, d1, d2)
  # impute the data set by changing the imputed values
  # using mice's post-processing capability
  imp.all <- vector("list", length(delta))
  for (i in 1:length(delta[[1]])){
    for (var in vars$missing) {
      d <- delta[[var]][i]
      cmd <- paste("imp[[j]][,i] <- imp[[j]][,i] +", d)
      post[[var]] <- cmd
    imp <- mice::mice(data, post = post, maxit = 5, seed = 1, print = FALSE)
    imp.all[[i]] <- imp

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.