Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: Conditional Imputation using - mi impute chained -
From
daniel klein <[email protected]>
To
[email protected]
Subject
st: Conditional Imputation using - mi impute chained -
Date
Tue, 12 Jun 2012 19:24:18 +0200
Isaac,
I wonder, why you think that -mi impute- will create (change or
update) the values of your indicator variable, that you create (once)
before you start the imputation, automatiocally while imputing. I do
not think -mi- does this. I recommend reading the manual closely,
which does (in my understanding) not document such behavior of -mi-. I
also do not belive that there is an easy (if any) solution to fix your
problem if missing values are not nested. Unfortunatly, I do not have
the time right know to have a closer look at this.
Regarding the code you show us, it seems to me, the conditions
conditional(if agecat > 1))
and
conditional(if workingage == 1))
are exactly the same. As you already indicate, I think your second
syntax therefore only appears to do what you want. You do not mention
<workingage> (your indicator) in your imputation model. My guess is
that missing observations in this variable (these are the same as in
agecat) are not imputed (and also not updated), but merely dropped
from the imputation model of the other variables (i.e. <workimp>).
The problem with your approach is, that <workingage> has missing
values where <agecat> has missing values. Because <agecat>'s missing
values are not nested in <workimp>, <workingage>'s missing values are
not nested in <workimp> and therefore conditional imputation does not
work.
I hope others have better advice.
Best
Daniel
--
All,
[...]
So, after that, I want to condition the imputation of work on whether
a person was age 18 or older. However, issuing the following does NOT
work:
****
mi impute chained
....
(logit, ... conditional(if agecat > 1)) workimp, [options here]
****
because agecat's missing values are not nested in work.
The way I "worked around" this problem (in quotation marks because
I'm not sure this is correct) was by using - mi xeq - to generate an
indicator variable that tells - mi impute chained - which observations
of work that I want to be imputed using the conditional option:
***
mi xeq: gen workingage = agecat > 1 if ~missing(agecat)
...
mi impute chained
....
(logit, ... conditional(if workingage == 1)) workimp, [options here]
***
My thinking here is that after the first burn-in iteration, - mi
impute chained - simulates values for workimp and agecat. Then based
on these values it generates the workingage indicator variable, and
then on the next iteration it utilizes the value of that indicator to
condition the imputation of workimp.
Now, this APPEARS to do what I want: crosstabs of imputed agecat and
imputed workimp show that values of workimp are always zero if imputed
agecat == 1, and nothing looks otherwise unreasonable. But is this
the correct way to do what I'm trying to do? If not, do you have some
advice on how better to do it?
Thanks,
Isaac
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/