Dear statalist users,
This is the first time I'm using multiple imputations. I am using a multilevel data set with individuals clustered in countries. I want to impute missing values for income, and two anxiety measures. This is what I've come up with so far:
I'm happy with the values imputed for the variables that had missing values (inc, stanx1, stanx2). But this imputation method does not consider the clustering of the data. Also I have noticed that in the imputed observations, the level-2 variables are different than from the original data, e.g. gini-values of certain countries are not correct. Thus, I do not want the level-2 variables (pdi, idv, gini_disp, gdp) to change for the imputed observations. I also want to transform variables with missing values later on like this:
I am not sure how I should do that with the mi estimate prefix.
The final analysis step is a mixed-effects model that includes interactions. Is there something I need to consider for the inclusion of interaction terms?
I'd by very grateful for any advice on these questions. Thank you!
This is the first time I'm using multiple imputations. I am using a multilevel data set with individuals clustered in countries. I want to impute missing values for income, and two anxiety measures. This is what I've come up with so far:
Code:
nscore inc stanx1 stanx2, gen(nscore) mi set mlong mi register imputed nscore* sex age educ empstat pdi idv gini_disp gdp country set seed 46352 mi impute mvn nscore* sex age educ empstat pdi idv gini_disp gdp country, add(5) rseed(46352) invnscore inc stanx1 stanx2
Code:
egen incrank = xtile(inc), n(100) by(country) factor stanx1 stanx2, factors(1) predict stanx_factor
The final analysis step is a mixed-effects model that includes interactions. Is there something I need to consider for the inclusion of interaction terms?
Code:
mi estimate: mixed stanx_factor incrank inc educ age sex empstat pdi idv gdp gini_disp c.incrank#c.pdi c.incrank#c.idv || country: incrank, mle
Comment