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: twoway graph for imututed values against observed
From
[email protected] (Wesley D. Eddings, StataCorp)
To
[email protected]
Subject
Re: st: twoway graph for imututed values against observed
Date
Wed, 25 Jan 2012 17:40:44 -0600
Andy Stoddart ([email protected]) asked about checking the imputations
created by -mi ice-:
> Does anyone know of a way to graph the imputed values over the observed values
> on the same graph?
> For example I am at present using
> mi set wide
> mi ice ? , add(5) [options]
> twoway (hist x1, [options]) (hist _1_x1 if missing(x1), [options]), ///
> legend(label(1 "observed") label(2 "imputed"))
> I then view each of the 5 imputations by swapping _1_x1 for
> _2_x1, _3_x1, _4_x1 and _5_x1 in turn to quickly check the imputed
> values appear reasonable
> Obviously it would be preferable to be able to plot all imputed values
> against all observed directly rather than checking individual
> imputations one at a time.
It is possible to use -mi xeq-, rather than repeatedly changing the name of the
variable to be graphed. Here are the commands to make Andy's plots for all five
imputations:
. generate byte miss_x1 = missing(x1)
. qui mi xeq 1/5: twoway (hist x1 if miss_x1==0) || ///
(hist x1 if miss_x1==1), ///
legend(label(1 "observed") label(2 "imputed")); ///
set more on; more; set more off
It's safe to -generate- the "miss_x1" variable because Andy is using the -wide-
-mi- style. I took the commands from the note on multiple-imputation
diagnostics, which includes other plots Andy might find useful. The note is
available at
http://www.stata.com/users/ymarchenko/midiagnote.pdf
It is usual to check each imputed dataset separately. I do not know of any
research on comparing the aggregate of the observed data to the aggregate of the
imputed values.
--Wes
[email protected]
*
* 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/