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]
Re: st: how OK is -mi estimate, errorok- ?
From
Miguel Dorta <[email protected]>
To
[email protected]
Subject
Re: st: how OK is -mi estimate, errorok- ?
Date
Tue, 29 Oct 2013 16:01:57 -0500
Stas Kolenicov <[email protected]> asks about the -errorok- option of
the -mi estimate- command:
>I am trying to circumvent an issue that -proportion- sometimes return
>what looks like a reasonable zero estimate (just because the data are
>like that), but -mi estimate- seems to have problems with it, even
>with -errorok- option:
>
>sysuse auto, clear
>mi set wide
>mi register imputed rep78
>mi register regular weight
>mi impute chained (pmm) rep78, add(3)
>mi estimate : proportion rep78, over( foreign )
>mi estimate, errorok : proportion rep78, over( foreign )
>mi estimate, noisily : proportion rep78, over( foreign )
>
>It's not that bad in my data, but some proportions are really small in
>one of the subpopulations, and they get zero imputed counts every now
>and then. But most imputation would produce the full vector of
>coefficients. Nevertheless, -errorok- fails to handle that.
When an estimation command used with -mi estimate- executes with an error in
at least one of the imputations, -mi estimate- stops and flags the problem. To
proceed with estimation and discard the offending imputations, you can use the
-errorok- option; also see -help mi estimate-.
In Stas's example, the -proportion- command executes successfully on all
imputations. The error message that Stas receives:
mi estimate: no observations in some imputations
This is not allowed. To identify offending imputations, you can use mi
xeq to run the command on individual imputations or you can reissue the
command with mi estimate, noisily
r(498);
is issued because of -mi estimate-'s internal checks of the consistency of
results from all of the imputations. The -errorok- option has no control over
these checks.
The inconsistency between imputation results in Stas's example is caused by
the fact that the -rep78- variable has no observations in some of its
categories in some of the imputations when it is cross-classified with the
-foreign- variable. If -rep78- had no observations in the same categories
across imputations, -mi estimate- would proceed without error and report
results for all of the categories which contain observations.
One solution is to use -mi xeq- to identify the offending imputations and
perform MI estimation using only non-offending imputations. You can specify
the list of imputations in -mi estimate-'s option -imputations()-.
. mi xeq: proportion rep78, over(foreign)
(output omitted)
The output from -mi xeq- indicates that the second imputation is the offending
imputation. We can then perform MI estimation using only imputations 1 and 3:
. mi estimate, imputations(1 3): proportion rep78, over(foreign)
(output omitted)
-- Miguel
[email protected]
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/