Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Impute using multivariate normal regression (mi impute mvn)

    Dear Statalist community,

    I am seeking guidance as I am facing challenges in performing multiple imputation using the mi impute mvn command (using Stata 18).

    Here are the steps I have taken:
    • Loaded the example dataset (I prefer to use first example data bases for learning before going to perform it in my real database):
    use https://www.stata-press.com/data/r18/mheart5s0.dta
    • Created a table to examine missing data:
    mi misstable summarize, all
    • Realized that I needed to impute data for the variables age and bmi.
    • Attempted to impute multiple variables simultaneously:
    mi impute mvn bmi attack smokes age female, add(20) rseed(1234)
    • Faced an issue with variables attack, smokes, and female not being registered as imputed; hence, unregistered and registered them:
    mi unregister attack smokes female mi register imputed attack smokes female
    • Tried the imputation command again:
    mi impute mvn bmi attack smokes age female, add(20) rseed(1234)
    • Received this output:
      note: variables attack smokes female contain no soft missing (.) values; imputing nothing

      Performing EM optimization:
      observed log likelihood = -530.87093 at iteration 11

      Performing MCMC data augmentation ...

      Multivariate imputation Imputations = 40
      Multivariate normal regression added = 20
      Imputed: m=21 through m=40 updated = 0

      Prior: uniform Iterations = 2000
      burn-in = 100
      between = 100

      ------------------------------------------------------------------
      | Observations per m
      |----------------------------------------------
      Variable | Complete Incomplete Imputed | Total
      -------------------+-----------------------------------+----------
      bmi | 126 28 28 | 154
      attack | 154 0 0 | 154
      smokes | 154 0 0 | 154
      age | 142 12 12 | 154
      female | 154 0 0 | 154
      ------------------------------------------------------------------
      (Complete + Incomplete = Total; Imputed is the minimum across m
      of the number of filled-in observations.)
    • Saved the imputation results:
    save final_imputation_data
    • Checked the imputed data using edit or mi misstable summarize, all, but still found the same missing values.
    I am uncertain about what I might be doing wrong and how to save the imputed data correctly.
    I already try to have a look on mimiimputemvn.pdf (stata.com) and through previous post, but couldn't find an answer.
    Any assistance from the Statalist community would be greatly appreciated.

    Sincerely,

    Carolina
    Last edited by Carolina Hincapie; 01 Feb 2024, 05:19.

  • #2
    Have a look at [MI] Styles -- Dataset styles (p. 352--359) to understand how imputed, i.e., completed, datasets are stored. The example data you use is in mlong style. You can find that out by typing

    Code:
    mi query
    The observations with missing values are still in the same dataset after imputation. There is nothing wrong with that.

    Comment


    • #3
      By the way, conceptually, you probably want to list the regular variables as predictors in your imputation model, like this:

      Code:
      mi impute mvn bmi age = i.attack i.smokes i.female i.hsgrad , add(#) ...

      Comment

      Working...
      X