I'm doing multiple imputation using chained equations (MICE) on a set of ordinal variables:
- qualification (neww2edqual): higher=1, intermediate=2 and no qual=3
- income (nfwq5_bu_s): quintile1=1, quintile2=2,..., quintile5=5
- smoking (bhesmk): smoker=1, non-smoker=0
- drinking (newscako): regularly=1, occasionally=2, rarely=3
- physical activity level (newpalevel): low=1, moderate=2, high=3
mi impute chained (ologit)neww2edqual (ologit)nfwq5_bu_s (logit)bhesmk (ologit)newscako (ologit)newpalevel, add(10)
but got the error:
outcome does not vary; remember:
0 = negative outcome,
all other nonmissing values = positive outcome
-- above applies to specification (logit ) bhesmk
I understood that this may be due to my coding of the above variables, and that logistic regression needs the variables to be in 0, 1, etc. form, but even when I recoded neww2edqual (as a trial to see if this works), the error message still popped up. The example on UCLA IDRE (https://stats.idre.ucla.edu/stata/se...stata_pt1_new/) seemed to be ok with categorical variable coded 1, 2, 3 though.
Can you help me shed some light on where I've gone wrong, and what I can do to fix this problem?
Many thanks,
Hai
0 Response to MICE with ordinal categorical variables
Post a Comment