Announcement

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

  • Missing values imputation in Stata

    Hello everyone, I was hoping for some advice on the best method to impute missing values for my dataset. I am using Stata 17 on Windows 10. The dataset consists of socioeconomic data for Iraq's 17 governorates (one governorate was excluded from analysis). There are 21 variables, one being the Governorate name variable (string) and another being the encoded governorate variable, and a total of 5 missing values. To be more specific, Governorate X has missing values for 5 different variables, meaning that all the missing values belong to the same observation. I am wondering what the best command for imputing these missing values is.

    I have tried using the user-written command hotdeckvar and even though the code worked, I am not convinced it's the best method as the helpfile recommends using it for binary 0-1 variables, and the imputation is done by randomly selecting a value for the same variable from another observation.

    I also tried using the mi command using the following code to impute the missing value for 'unempl' by using correlated variables within the dataset:

    mi set mlong
    mi register imputed unemp

    mi impute regress unemp hhh_female illiteracy adult_mort doctors, add(5) rseed(2232) force

    mi xeq 0 1 2 3 4 5 : summarize unemp

    mi extract 1, clear


    The issue I run into here is that I need to extract the imputed values in order to continue my analysis, as the commands I need to use later cannot be run within the mi environment and I also need to submit the completed dataset as part of my workflow.

    Lastly, when I use the user-written hotdeck command with the code below, the governorate variable disappears from the imputed dataset and it therefore becomes complicated to continue the analysis.

    hotdeck unemp livestock house_own illiteracy food_insec, store imp(1)


    Any and all advice would be appreciated, and I apologize if my post is unclear -- please let me know if you would like clarifications or if you have a suggestion for me!

Working...
X