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

RE: st: Best method for imputing dichotomous variables

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

--- Maarten buis <> 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

Hope this helps,

*----------------------- 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'
simulate pwrongimp=r(pwrongimp) pwrongice=r(pwrongice) ///
         bimp=r(bimp) bice=r(bice), rep(100):sim
*--------------------- end simulation -------------------------
(For more on how to use examples I sent to the Statalist, see: )

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

Sent from Yahoo! Mail - a smarter inbox

*   For searches and help try:

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