Announcement

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

  • MI extract does not extract one of the imputed variables

    Hi!

    I have a dataset with 60 variables that were imputed using MICE. Unfortunately, one variable were excluded by mistake from the imputation and hence I imputed it using MICE after the first imputation was finished. The imputation was finished and all well, but when using MI extract, var61 does not get its imputed values with it!

    Code:
    set more off
    set matsize 11000
    mi set wide
    mi register imputed var1-var60 
    mi impute chained (pmm, knn(3)) var1-var60, add(10)
    
    * And then 
    
    set more off
    set matsize 11000
    mi set wide
    mi register imputed var61
    mi impute chained (pmm, knn(3)) var61, add(10)
    
    ** Which gives me the following output **
            Observations per m               
                
    Variable    Complete    Incomplete   Imputed    Total
                
    var61    40375    3    3    40378
    
    
    * And then I try with the mi extract
    mi extract 1 
    
    sum var61
        Variable |        Obs        Mean    Std. dev.       Min        Max
    -------------+---------------------------------------------------------
    var61 |     40,375    1.755012    1.261333          1          6
    What is the problem? It feels like something obvious I'm missing.

  • #2
    That's not how mi works. In your situation, var61 does not have imputed values in the first 10 imputed datasets. That is made evident by mi extract command. Instead, var61 does have imputed values in the 10 imputed datasets 11 to 20. Yes, your code has created 20 imputed datasets. Unfortunately, none of the other variables will have imputed values in the datasets 11 to 20.

    Moreover, you impute var61 with no predictors at all. Thus, the imputed values will be uncorrelated with all other variables. You do not want to do that.

    What you want to do is delete all imputations and start over from scratch, this time including var61 in the imputation model.
    Last edited by daniel klein; 18 Jan 2024, 07:32.

    Comment


    • #3
      Thank you, I understand what you mean and performed a new imputation!

      Comment

      Working...
      X