Bookmark and Share

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


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

Re: st: mi import + xtmixed


From   weddings@stata.com (Wes Eddings, StataCorp)
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: mi import + xtmixed
Date   Wed, 09 May 2012 14:55:54 -0500

Elizabeth Covay (ecovay@alumni.nd.edu) asked about using -mi import- with a
longitudinal dataset, where the dataset had been subdivided, imputed in -ice-,
and then re-combined:

> We used the -ice- command for multiple imputation for a longitudinal data set.
> The data was in three separate files (one for each wave) when we did the
> multiple imputation. We have since combined these three waves into one
> longitudinal data set where each student is in the data set for each wave and
> for each multiply imputed data set (3 waves x 10 multiply imputed data sets).
> We are running into problems using the -mi import- command since the student
> id and imputation number id is not a unique combination.
>
> (snip)
>
> Our current solution is to create a new student id that is a combination of
> the original id and the wave so that there is a unique combination of student
> id and imputation number. Once we have the -mi import- done using our new
> student id we plan to use the proper mi estimate command with the original
> student id. Does anyone see problems with this method?

There isn't a problem with this method, but there is another way, one that does
not require a new ID variable.  Elizabeth has three files after using -ice-.
She can run -mi import- separately on each of the three files, and then use 
-mi append- to join the three -mi- datasets.  The commands might look like this:

     . use icedata1
     . mi import ice, automatic
     . save midata1
     
     * (repeat for icedata2 and icedata3)

     . use midata1, clear
     . mi append using midata2
     . mi append using midata3

The -mi append- command works like -append-, but for -mi- data.  -mi append-
must be run one time for each -using- dataset to be appended.

--Wes
weddings@stata.com

*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index