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 on April 23, and its replacement, is already up and running.

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

Re: st: flongsep and pooled estimates

From   Joerg Luedicke <>
Subject   Re: st: flongsep and pooled estimates
Date   Fri, 17 Jun 2011 10:37:13 -0400

You could pool the stuff yourself. For parameter estimates, you can
simply take the average across imputations. For variance estimates,
you will need to take the within- and between-imputation variance into
account. Below is a small example how this can be done. You should
have a look at the Rubin's combination rules stuff and especially at
Stata's mi documentation where those formulas are explicitly


sysuse auto, clear // get some data and create missings
replace  mpg=. if  weight>4000

mi set flong // mi set up
mi register imputed mpg
mi register reg price
mi impute reg mpg price, add(5) rseed(3415)

sort  _mi_id  _mi_m // check what's going on
list in 1/18, sepby(_mi_id)

mi estimate: reg price mpg  // running a regression with mi estimate
est sto M1  // store to compare with own calculation later

statsby _b _se, clear by(_mi_m): regress price mpg //creating a data
set with coefficients and SEs across imputations

drop if _mi_m==0 // keeping only imputed data sets

gen se2=_se_mpg^2 // within-imputation variance
egen U=mean(se2)

sum _b_mpg // between imputation variance
gen biv=(_b_mpg-r(mean))^2
egen bt=total(biv)
gen B=bt/4

gen T=sqrt(U+(1+1/5)*B) // square root of the total variance

est replay M1 // comparing results
qui sum _b_mpg, meanonly
di r(mean)
list T in 1/1

On Fri, Jun 17, 2011 at 9:12 AM, Wike, Traci <> wrote:
> Is there any other way to pool estimates other than using mi estimate?
> ________________________________________
> From: [] on behalf of Joerg Luedicke []
> Sent: Friday, June 17, 2011 12:59 AM
> To:
> Subject: Re: st: flongsep and pooled estimates
> On Thu, Jun 16, 2011 at 10:24 PM, Wike, Traci <> wrote:
>> Hi everyone,
>> I am running an analysis on m=0 using the flongsep format for my imputed data--flongsep automatically updates the other imputed datasets based on m=0--does this mean that it pools estimates the same way the command mi estimate does? I am trying to work around mi estimate because it does not support a command I need.
> If you run your analysis on m=0 then you do not use any imputed data.
> -flongsep- defines one of four ways to store/handle your multiply
> imputed data (-help mi set-). Specifically, when using the -flongsep-
> format, M+1 data files are stored separately. For example, if you
> impute 3 data sets (M=3) you save separate files for m=0, m=1, m=2,
> and m=3. For cases without imputed values m1=m2=m3=m0 because of the
> full long format. For cases with imputed data, the values vary across
> m1 to m3 and are missing in m0. In any case, this is not affecting the
> way estimates are combined after running an estimation command.
> J.
> *
> *   For searches and help try:
> *
> *
> *
> *
> *   For searches and help try:
> *
> *
> *

*   For searches and help try:

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