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]

Re: st: Multiple imputation combined with collapse


From   Chris Parker <cparker.phd2007@london.edu>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Multiple imputation combined with collapse
Date   Wed, 3 Aug 2011 06:54:33 -0400

Hi Steven,

Yes, I think it's the way that _mi_miss is augmented in the collapse.
- mi - no longer knows which observations have missing data. I've gone
the way that Richard suggested, collapsing the data and then imputing
the observations where any of the uncollapsed data was missing.

Chris

On Tue, Aug 2, 2011 at 8:08 PM, Steven Samuels <sjsamuels@gmail.com> wrote:
>
> --
>
> Chris, the passive variables have nothing to do with it. -mi xeq collapse- shows the same behavior without them.  Here's your example, modified.
>
> *****************
> 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(4)
> mi xeq: collapse y x _*, by(groupvar)
> *******************
>
> On Jul 30, 2011, at 1:07 PM, Chris Parker wrote:
>
> 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/
>
>
> *
> *   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/
>
> ______________________________________________________________________
>
> 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