help mi impute
-------------------------------------------------------------------------------
Title
[MI] mi impute -- Impute missing values
Syntax
mi impute method ... [, impute_options ... ]
method description
-------------------------------------------------------------------------
Univariate
regress linear regression for a continuous variable
pmm predictive mean matching for a continuous
variable
logit logistic regression for a binary variable
ologit ordered logistic regression for an ordinal
variable
mlogit multinomial logistic regression for a nominal
variable
Multivariate
monotone sequential imputation using a monotone-missing
pattern
mvn multivariate normal regression
-------------------------------------------------------------------------
impute_options description
-------------------------------------------------------------------------
Main
* add(#) specify number of imputations to add; required
with no imputations
* replace replace imputed values in existing imputations
rseed(#) specify random-number seed
double save imputed values in double precision; the
default is to save them as float
Reporting
dots display dots as imputations are performed
noisily display intermediate output
Advanced
force proceed with imputation even when missing imputed
values are encountered
+ noupdate do not mi update; see [MI] noupdate option
-------------------------------------------------------------------------
* add(#) is required when no imputations exist; add(#) or replace is
required if imputations exist.
+ noupdate does not appear in the dialog box.
You must mi set your data before using mi impute; see [MI] mi set.
Menu
Statistics > Multiple imputation
Description
mi impute fills in missing values (.) of a single variable or of multiple
variables using the specified method. The available methods (by variable
type and missing-data pattern) are summarized in the tables below.
Single imputation variable (univariate imputation)
------------------------------------------------------------
Pattern Type Method
------------------------------------------------------------
continuous regress, pmm
always monotone binary logit
categorical ologit, mlogit
------------------------------------------------------------
Multiple imputation variables (multivariate imputation)
------------------------------------------------------------
Pattern Type Method
------------------------------------------------------------
monotone missing mixture monotone
arbitrary missing continuous mvn
------------------------------------------------------------
See Remarks for details.
Options
+------+
----+ Main +-------------------------------------------------------------
add(#) specifies the number of imputations to add to mi data. This
option is required if there are no imputations in the data. If
imputations exist, then add() is optional. The total number of
imputations cannot exceed 1,000.
replace specifies to replace existing imputed values with new ones. One
of replace or add() must be specified when mi data already have
imputations.
rseed(#) sets the random-number seed. This option can be used to
reproduce results. rseed(#) is equivalent to typing set seed # prior
to calling mi impute.
double specifies that the imputed values be stored as doubles. By
default, they are stored as floats. mi impute stores the values
using double or float precision only when necessary. For example, if
the logit method is used, the imputed values are stored as bytes.
+-----------+
----+ Reporting +--------------------------------------------------------
dots specifies to display dots as imputations are successfully completed.
An x is displayed if any of the specified imputation variables still
have missing values.
noisily specifies that intermediate output from mi impute be displayed.
+----------+
----+ Advanced +---------------------------------------------------------
force specifies to proceed with imputation even when missing imputed
values are encountered. By default, mi impute terminates with error
if missing imputed values are encountered.
noupdate in some cases suppresses the automatic mi update this command
might perform; see [MI] noupdate option. This option is rarely used.
Remarks
Using mi impute
Imputation methods
Using mi impute
The data must be mi set prior to using mi impute. All variables whose
missing values are to be filled in must be registered as imputed
variables; see mi register. If there are no imputations, you must
specify add(). If imputations already exist, you must specify either
add() or replace.
If you do not have imputations, you must specify the number of
imputations to add in add(). If you already have imputations, you have
three choices:
1. Add new imputations to the existing ones -- specify the add() option.
2. Add new imputations and also replace the existing ones -- specify
both the add() and the replace options.
3. Replace existing imputed values -- specify the replace option.
mi impute may change the type of the specified imputation variables and
the sort order of the data.
Imputation methods
Univariate imputation is used to impute one variable. It can also be
justified for multiple imputation variables provided they are independent
and will be used in separate analyses. To impute one variable, you can
choose from the following five methods: regress, pmm, logit, ologit, and
mlogit.
For a continuous variable, either regress or pmm can be used. For a
binary variable, logit is the preferred method. For a categorical
variable, ologit can be used to impute missing categories if they are
ordered, and mlogit can be used to impute missing categories if they are
unordered.
In practice, often multiple variables must be imputed simultaneously that
requires using a multivariate-imputation method. The choice of an
imputation method in this case depends on a pattern of missing values in
imputation variables.
If imputation variables follow a monotone-missing pattern, they can be
imputed sequentially using univariate conditional distributions which is
implemented in monotone. A separate univariate imputation model can be
specified for each imputation variable which allows simultaneous
imputation of variables of different types.
When a pattern of missing values is arbitrary, an iterative method is
required to fill in missing values. mvn uses multivariate normal data
augmentation (MCMC method) to imputed missing values of continuous
imputation variables.
Examples: Univariate imputation
Regression; make 20 imputations, and then add 30 more
. webuse mheart1s0
. mi describe
. mi impute regress bmi attack smokes age female hsgrad, add(20)
. mi impute regress bmi attack smokes age female hsgrad, add(30)
Predictive mean matching; 50 imputations.
. webuse mheart1s0
. mi impute pmm bmi attack smokes age female hsgrad, add(50)
Examples: Multivariate imputation
Monotone missing pattern; 10 imputations
. webuse mheart5s0
. mi describe
. mi misstable nested
. mi impute monotone (regress) age bmi = attack smokes hsgrad female,
add(10)
Arbitrary pattern (or monotone); 10 imputations
. webuse mheart5s0
. mi impute mvn bmi = attack smokes hsgrad female, add(10) nolog
Examples: Imputing on subsamples
Impute males and females separately; 20 imputations
. webuse mheart1s0
. mi impute regress bmi attack smokes age hsgrad if female==1,
add(20)
. mi impute regress bmi attack smokes age hsgrad if female==0,
replace
Saved results
mi impute saves the following in r():
Scalars
r(M) total number of imputations
r(M_add) number of added imputations
r(M_update) number of updated imputations
r(k_ivars) number of imputed variables
Macros
r(method) name of imputation method
r(ivars) names of imputation variables
r(rseed) random-number seed used
Matrices
r(N) number of observations in imputation sample
(per variable)
r(N_complete) number of complete observations in imputation
sample (per variable)
r(N_incomplete) number of incomplete observations in
imputation sample (per variable)
r(N_imputed) number of imputed observations in imputation
sample (per variable)
Also see Saved results in the method-specific entries for a list of
additional saved results.
Also see
Manual: [MI] mi impute
Help: [MI] mi impute regress, [MI] mi impute pmm, [MI] mi impute
logit, [MI] mi impute mlogit, [MI] mi impute ologit, [MI] mi
impute monotone, [MI] mi impute mvn, [MI] mi estimate, [MI] mi