Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: Best method for imputing dichotomous variables


From   Maarten buis <[email protected]>
To   [email protected]
Subject   RE: st: Best method for imputing dichotomous variables
Date   Thu, 14 Feb 2008 14:14:09 +0000 (GMT)

--- Maarten buis <[email protected]> wrote:
> Counterintuitive as it may sound the "better" performance of -impute-
> is actualy the result of the fact that is is worse than -ice- (it
> ignores the uncertainty around the prediction). 

This point is illuatrated in the simulation below: -ice- gets a larger
porportion of imputations "wrong" (pwrongice) than -impute-
(pwrongimp), but -ice- was able to recover the correct relationship
between y and x (1) while -impute- is way off. The reason is that
multiple imputation is not meant to recover individual values but
statistics like the mean, the variance, the correlation or the log odds
ratio.

Hope this helps,
Maarten

*----------------------- begin simulation -----------------------
capture program drop sim
program define sim, rclass
	drop _all
	set obs 5000
	gen x = invnorm(uniform())
	gen y = uniform() < invlogit(x)

	gen ymis = cond(uniform() < invlogit(-2 + 2*x), ., y)
	count if missing(ymis)
	local Nmis = r(N)
		
	impute ymis x, gen(yimp)
	replace yimp = cond(yimp < .5, 0, 1)
	count if yimp != y
	return scalar pwrongimp = r(N)/`Nmis'	

	logit yimp x
	return scalar bimp = _b[x]

	tempfile imp
	ice ymis x, saving(`imp') m(5)
	use `imp', clear
	micombine logit ymis x
	return scalar bice = _b[x]

	count if ymis != y & _mj == 1
	return scalar pwrongice = r(N)/`Nmis'
end
simulate pwrongimp=r(pwrongimp) pwrongice=r(pwrongice) ///
         bimp=r(bimp) bice=r(bice), rep(100):sim
sum
*--------------------- end simulation -------------------------
(For more on how to use examples I sent to the Statalist, see:
http://home.fsw.vu.nl/m.buis/stata/exampleFAQ.html )



-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------


      __________________________________________________________
Sent from Yahoo! Mail - a smarter inbox http://uk.mail.yahoo.com

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index