**[MI] mi impute monotone** -- Impute missing values in monotone data

__Syntax__

Default specification of prediction equations, basic syntax

**mi** __imp__**ute** __mon__**otone** **(***uvmethod***)** *ivars* [**=** *indepvars*] [*if*] [*weight*] [**,**
*impute_options* *options*]

Default specification of prediction equations, full syntax

**mi** __imp__**ute** __mon__**otone** *lhs* [**=** *indepvars*] [*if*] [*weight*] [**,** *impute_options*
*options*]

Custom specification of prediction equations

**mi** __imp__**ute** __mon__**otone** *cmodels* [*if*] [*weight*]**,** __c__**ustom** [*impute_options*
*options*]

where *lhs* is *lhs_spec* [*lhs_spec* [...]] and *lhs_spec* is

**(***uvmethod* [*if*] [**,** *uvspec_options*]**)** *ivars*

*cmodels* is **(***cond_spec***)** [**(***cond_spec***)** [...]] and a conditional
specification, *cond_spec*, is

*uvmethod* *ivar* [*rhs_spec*] [*if*] [**,** *uvspec_options*]

*rhs_spec* includes *varlist* and expressions of imputation variables bound
in parentheses.

*ivar*(*s*) (or *newivar* if *uvmethod* is **intreg**) is the name(s) of the
imputation variable(s).

*uvspec_options* are __asc__**ontinuous**, __noi__**sily**, and the method-specific *options*
as described in the manual entry for each univariate imputation
method.

*uvmethod* Description
-------------------------------------------------------------------------
__reg__**ress** linear regression for a continuous variable; **[MI] mi**
**impute regress**
**pmm** predictive mean matching for a continuous variable; **[MI]**
**mi impute pmm**
**truncreg** truncated regression for a continuous variable with a
restricted range; **[MI] mi impute truncreg**
**intreg** interval regression for a continuous partially observed
(censored) variable; **[MI] mi impute intreg**
__logi__**t** logistic regression for a binary variable; **[MI] mi**
**impute logit**
__olog__**it** ordered logistic regression for an ordinal variable;
**[MI] mi impute ologit**
__mlog__**it** multinomial logistic regression for a nominal variable;
**[MI] mi impute mlogit**
**poisson** Poisson regression for a count variable; **[MI] mi impute**
**poisson**
**nbreg** negative binomial regression for an overdispersed count
variable; **[MI] mi impute nbreg**
-------------------------------------------------------------------------

*options* Description
-------------------------------------------------------------------------
Main
* __c__**ustom** customize prediction equations of conditional
specifications
__aug__**ment** perform augmented regression in the presence of perfect
prediction for all categorical imputation variables
__boot__**strap** estimate model parameters using sampling with
replacement

Reporting
**dryrun** show conditional specifications without imputing data
**verbose** show conditional specifications and impute data; implied
when **custom** prediction equations are not specified
**report** show report about each conditional specification

Advanced
**nomonotonechk** do not check whether variables follow a monotone-missing
pattern
-------------------------------------------------------------------------
* **custom** is required when specifying customized predictions equations.
You must **mi** **set** your data before using **mi** **impute** **monotone**; see **[MI] mi**
**set**.
You must **mi** **register** *ivars* as imputed before using **mi** **impute** **monotone**;
see **[MI] mi set**.
*indepvars* and *rhs_spec* may contain factor variables; see fvvarlist.
**fweight**s, **aweight**s (**regress**, **pmm**, **truncreg**, and **intreg** only), **iweight**s,
and **pweight**s are allowed; see weight.

__Menu__

**Statistics > Multiple imputation**

__Description__

**mi** **impute** **monotone** fills in missing values in multiple variables by using
a sequence of independent univariate conditional imputation methods.
Variables to be imputed, *ivars*, must follow a monotone-missing pattern
(see **[MI] intro substantive**). You can perform separate imputations on
different subsets of the data by specifying the **by()** option. You can
also account for frequency, analytic (with continuous variables only),
importance, and sampling weights.

__Options__

+------+
----+ Main +-------------------------------------------------------------

**custom** is required to build customized prediction equations within the
univariate conditional specifications. Otherwise, the default
specification of prediction equations is assumed.

**add()**, **replace**, **rseed()**, **double**, **by()**; see **[MI] mi impute**.

**augment** specifies that augmented regression be performed if perfect
prediction is detected. By default, an error is issued when perfect
prediction is detected. The idea behind the augmented-regression
approach is to add a few observations with small weights to the data
during estimation to avoid perfect prediction. See *The issue of*
*perfect prediction during imputation of categorical data* under
*Remarks and examples* in **[MI] mi impute** for more information. **augment**
is not allowed with importance weights. This option is equivalent to
specifying **augment** within univariate specifications of all
categorical imputation methods.

**bootstrap** specifies that posterior estimates of model parameters be
obtained using sampling with replacement; that is, posterior
estimates are estimated from a bootstrap sample. The default is to
sample the estimates from the posterior distribution of model
parameters or from the large-sample normal approximation of the
posterior distribution. This option is useful when asymptotic
normality of parameter estimates is suspect. This option is
equivalent to specifying **bootstrap** within all univariate
specifications.

The following options appear on a Specification dialog that appears when
you click on the **Create ...** button of the **Main** tab.

*uvspec_options* are options specified within each univariate imputation
method, *uvmethod*. *uvspec_options* include __asc__**ontinuous**, __noi__**sily**, and
the method-specific *options* as described in the manual entry for each
univariate imputation method.

**ascontinuous** specifies that categorical imputation variables
corresponding to the current *uvmethod* be included as continuous
in all prediction equations. This option is only allowed when
*uvmethod* is **logit**, **ologit**, or **mlogit**.

**noisily** specifies that the output from the current univariate model
fit to the observed data be displayed.

+-----------+
----+ Reporting +--------------------------------------------------------

**dots**, **noisily**, **nolegend**; see **[MI] mi impute**. **noisily** specifies that the
output from all univariate conditional models fit to the observed
data be displayed. **nolegend** suppresses all imputation table legends
which include a legend with the titles of the univariate imputation
methods used, a legend about conditional imputation when
**conditional()** is used within univariate specifications, and group
legends when **by()** is specified.

**dryrun** specifies to show the conditional specifications that would be
used to impute each variable without actually imputing data. This
option is recommended for checking specifications of conditional
models prior to imputation.

**verbose** specifies to show conditional specifications and impute data.
**verbose** is implied when custom prediction equations are not
specified.

**report** specifies to show a report about each univariate conditional
specification. This option, in a combination with **dryrun**, is
recommended for checking specifications of conditional models prior
to imputation.

+----------+
----+ Advanced +---------------------------------------------------------

**force**; see **[MI] mi impute**.

**nomonotonechk** specifies not to check that imputation variables follow a
monotone-missing pattern. This option may be used to avoid
potentially time-consuming checks. The monotonicity check may be
time consuming when a large number of variables is being imputed. If
you use **nomonotonechk** with a custom specification, make sure that you
list the univariate conditional specifications in the order of
monotonicity or you might obtain incorrect results.

The following option is available with **mi impute** but is not shown in the
dialog box:

**noupdate**; see **[MI] noupdate option**.

__Examples: Default prediction equations__

Setup
**. webuse mheart5s0**

Describe **mi** data
**. mi describe**

Examine missing-data patterns
**. mi misstable nested**

Impute **bmi** and **age** via linear regression
**. mi impute monotone (regress) bmi age = attack smokes hsgrad female,**
**add(10)**

Impute **bmi** using linear regression, **age** using predictive mean matching
**. mi impute monotone (regress) bmi (pmm, knn(5)) age = attack smokes**
**hsgrad female, replace**

__Examples: Custom prediction equations__

Setup
**. webuse mheart6s0, clear**

Describe **mi** data
**. mi describe**

Examine missing-data patterns
**. mi misstable nested**

Specify custom equations for each of **hightar**, **bmi**, and **age**; include **bmi**
squared in equation for **age**
**. mi impute monotone ///**
**(logit hightar attack hsgrad female if smokes) ///**
**(pmm bmi hightar attack smokes hsgrad female, knn(5)) ///**
**(regress age bmi (bmi^2) hightar attack smokes hsgrad female),**
**custom add(10)**

__Examples: Imputing on subsamples__

Setup
**. webuse mheart5s0, clear**

Impute **bmi** and **age** using predictive mean matching separately for males
and females
**. mi impute monotone (pmm, knn(5)) bmi age = attack smokes hsgrad,**
**add(10) by(female)**

__Examples: Conditional imputation__

Setup
**. webuse mheart7s0, clear**

Describe **mi** data
**. mi describe**

Impute **bmi** and **age** using predictive mean matching, and **smokes** and **hightar**
using logistic regression; impute **hightar** using only observations for
which **smokes==1**
**. mi impute monotone ///**
**(pmm, knn(5)) bmi ///**
**(pmm, knn(5)) age ///**
**(logit, cond(if smokes==1)) hightar ///**
**(logit) smokes = attack hsgrad female, add(10)**

__Stored results__

**mi impute monotone** stores 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
**r(N_g)** number of imputed groups (**1** if **by()** is not
specified)

Macros
**r(method)** name of imputation method (**monotone**)
**r(ivars)** names of imputation variables
**r(rngstate)** random-number state used
**r(uvmethods)** names of univariate conditional imputation
methods
**r(by)** names of variables specified within **by()**

Matrices
**r(N)** number of observations in imputation sample in
each group (per variable)
**r(N_complete)** number of complete observations in imputation
sample in each group (per variable)
**r(N_incomplete)** number of incomplete observations in
imputation sample in each group (per
variable)
**r(N_imputed)** number of imputed observations in imputation
sample in each group (per variable)