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: Multiple Imputations by Chained Equations


From   Cristina Cleghorn <[email protected]>
To   "[email protected]" <[email protected]>
Subject   RE: st: Multiple Imputations by Chained Equations
Date   Mon, 31 Mar 2014 14:03:54 +0100

Hi,

Thanks for your email. 

I created a new dataset with just the under five year olds, one of the conditions.

Then I did the imputations by village, the other condition.

The first step worked fine but I got the same error on the second step, 

///estimation sample varies between m=1 and m=141; click here for details
///r(459);

(although the original error was estimation sample varies between m=1 and m=11)

Any further suggestions?

Thanks very much,

Cristina



-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of William Buchanan
Sent: 31 March 2014 13:12
To: [email protected]
Subject: Re: st: Multiple Imputations by Chained Equations

You have a conditional statement in the second step that is changing your estimation sample in the first step.  So, why would your imputation model work for the unrestricted sample and but only satisfactory for a subsample of it later?  What about the other conditions from the if statement?  Maybe this is an issue where you need to be more explicit throughout the imputation or find a way to create a better global model to impute that data.

HTH,
Billy

Sent from my iPhone

> On Mar 31, 2014, at 6:54, Cristina Cleghorn <[email protected]> wrote:
> 
> Hi,
> 
> I am trying to use Multiple Imputations by Chained Equations to overcome the missing data in my dataset.
> 
> 
> This first step works:
> 
> mi impute chained (regress) ragemnthsnew hagemnthsnew rheight hheight 
> hweight rbmi hbmi pemploy4new pedu3new pethnic2 = village rmphone 
> rwatersafe, add(10)
> 
> 
> But this second step:
> 
> mi estimate: regress sdsheightneg5to5 ddscore ragemnthsnew 
> hagemnthsnew pethnic2 rheight hheight rmphone pedu3new pemploy4new 
> rwatersafe if village==2 & under5==1
> 
> 
> gives this error:
> 
> 
> estimation sample varies between m=1 and m=11; click here for details 
> r(459);
> 
> Details:
> 
> Estimation sample varies across imputations
> 
>    There is something about the specified model that causes the estimation sample to be different between
>    imputations.  Here are several situations when this can happen:
> 
>    1.  You are fitting a model on a subsample that changes from one imputation to another.  For example, you
>        specified the if expression containing imputed variables.
> 
>    2.  Variables used by model-specific estimators contain values varying across imputations.  This results in
>        different sets of observations being used for completed-data analysis.
> 
>    3.  Variables used in the model (specified directly or used indirectly by the estimator) contain missing
>        values in sets of observations that vary among imputations.  Verify that your mi data are proper and, if
>        necessary, use mi update to update them.
> 
>    A varying estimation sample can lead to biased or less efficient estimates.  We recommend that you evaluate
>    the differences in records leading to a varying estimation sample before continuing your analysis.  To
>    identify the sets of observations varying across imputations, you can specify the esampvaryok option and save
>    the estimation sample as an extra variable in your data (in the flong or flongsep styles only) by using mi
>    estimate's esample() option.
> 
> 
> Note about a varying estimation sample with mi estimate using
> 
>    mi estimate checks for a varying estimation sample during estimation and saves the result in e(esampvary_mi)
>    equal to 1 if e(sample) varies and 0 otherwise.  If saving(miestfile) is used with mi estimate, the
>    varying-sample flag e(esampvary_mi) is also saved to miestfile.  mi estimate using checks that flag and
>    displays a warning message if its value is 1.  Thus mi estimate using displays the warning message even if
>    you are consolidating results from a subset of imputations for which the estimation sample may be constant;
>    you can suppress the message by specifying the nowarning option.
> 
>    To check whether the estimation sample changes for the selected subset of imputations, you can use mi
>    estimate to refit the model on the specified subset.  You can also save the estimation sample as an extra
>    variable by using mi estimate's esample() option during estimation.
> 
> 
> Does anyone know how I can avoid the error?
> 
> 
> Thanks very much,
> 
> Cristina
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/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/faqs/resources/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/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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