*! version 1.0 April 2014

Title

mirubin -- Combine estimation results from multiply imputed datasets by Rubin's rule (Version 1.0)

Syntax

mirubin [, options]

Main
stub(name) specify the stub of the estimation results

imputations(numlist) specify which imputations to use

force ignore checks before combining results (see below)

nosmall same as the nosmall option in mi estimate

repost Advanced option: see options below

Description

mirubin combines stored estimation results that share the same stub using
Rubin's rule.
As such, it is trying to do the same thing as mi estimate, except that users can
input their own estimation results rather than rely on mi estimate to derive them.
At the same time, many of the checks that are performed by mi estimate are not done by
mirubin.

mirubin, however, does check the following to ensure that the estimation results
are from the same estimation command.

1. The column names of the e(b) matrix, the column and row names of the e(V) matrix
have to be the same in all estimation results and in the same order.

2. All the e(N) have to be the same.

3. All the e(depvar) have to be the same.

4. All the e(cmd) have to be the same.

5. All the e(converged) have to be 1.

However, the above can be overridden with the force option.

Options

stub(name) specifies the stub of names of the estimation results from the
different imputed datasets. Stored results must have the following form:
stub1, stub2, stub3, etc. If the numbering of the results does not
go from 1 to n, then the imputations(numlist) option must be specified. If
stub(name) is not specified, mirubin replays the last estimation results.

imputations(numlist) specifies which imputations to use. If it is not specified,
mirubin searches for stub1, stub2, stub3, ..., and stops when
stub# does not exist.

force disables the checks that are done to the stored results before applying
Rubin's rule. See Description above.

nosmall See mi estimate, nosmall.

repost specifies instead of issuing ereturn post, mirubin should
instead issue ereturn repost. This has the effect of keeping the other e()
macros, scalars, and matrices of the first estimation results. Without this option,
mirubin only returns e(b) and e(V) which are the combined estimated coefficients
and variance. With repost we can access other returned results such as e(N)
but users should keep in mind that not all of the results would be relevant.

Remarks

mirubin generally produces results identical to those which would have been
obtained using mi estimate. However, at the moment, multivariate statistics
and tests are not calculated. (Users are welcome to contribute codes.) This means
that mi postestimation commands such as mi test are not available after
mirubin.

Example

mirubin is generally used together with mipllest, e.g.:

parallel setclusters 2

webuse mheart1s20

mi describe

mipllest: logit attack smokes age bmi hsgrad female

est dir _mipllest*

mirubin, stub(_mipllest_)

However, another use of mirubin is to obtain marginal effects from multiply
imputed datasets without having to define your own program.

webuse mheart1s20

mi convert flong // This is needed in order for margins below to work properly.

forval i=1/20 {

mi xeq `i' : logit attack smokes i.female##c.age bmi hsgrad

margins if _mi_m == `i', dydx(age) predict(xb) post noesample

est store marginage`i'

}

mirubin, stub(marginage)

Stored results

mirubin stores the following in e():

Matrices

e(b) Estimated coefficients combined by Rubin's rule

e(V) Variance of estimated coefficients combined by Rubin's rule

Macros

e(cmd) mirubin

e(depvar) Dependent variable

e(properties) b V

e(mi) mi

In addition, it also saves e(b_mi), e(V_mi), e(B_mi), e(W_mi),
e(df_mi), e(fmi_mi), e(pise_mi), e(rvi_mi), e(re_mi),
details of which can be found in mi_estimate. Note that
e(b)=e(b_mi) and e(V)=e(V_mi). Moreover, see the repost option,
which allows other results to be returned.

Author

Timothy Mak, University of Hong Kong
tshmak@hku.hk
April 2014