Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

st: Multiple imputation combined with collapse


From   "Chris Parker" <cparker.phd2007@london.edu>
To   <statalist@hsphsun2.harvard.edu>
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.

Chris

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

clear*
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 http://www.messagelabs.com/email
______________________________________________________________________

*
*   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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index