Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Multiple imputation combined with collapse

From   "Chris Parker" <>
To   <>
Subject   st: Multiple imputation combined with collapse
Date   Sat, 30 Jul 2011 18:07:40 +0100

Hi Statalist,

I have a question about multiple imputation. I have missing data in one
of my variables, x in the example below, which I then create several
passive variables for. I then collapse the data and try to run a
regression but the collapsed passive variables based on x are identical
to the collapsed original x variable. Does anyone know what I am doing
wrong here? I tried searching in [MI] but found no reference to
-collapse- which I take as a sign that I cannot do what I am trying to
do. Is -mi- unable to handle collapse?

Like some others on the list I am still (unfortunately) using Stata
11.2. My current machine OS is PC though I have tested this on a Unix
machine with the same results. I have not tested on a Mac as of yet.


***** Simulation Example *****

set obs 1000
set seed 1

gen y = runiform()
gen x = runiform()
gen groupvar = int(runiform()*10)
gen b = runiform()
replace x = . if b < .15
drop b

mi set wide
mi register imputed x
mi impute regress x y, add(10)

sort groupvar

mi passive: by groupvar: egen sumx = total(x)
mi passive: gen xshare = x/sumx
mi passive: gen xshare_sq = xshare^2
mi passive: by groupvar: egen hhi = total(xshare_sq)

mi xeq: collapse y x hhi _mi_*, by(groupvar)

mi estimate: regress y x hhi



This email has been scanned by the MessageLabs Email Security System
on behalf of the London Business School community.
For more information please visit

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index