Stata 15 help for manova_postestimation

```
[MV] manova postestimation -- Postestimation tools for manova

Postestimation commands

The following postestimation commands are of special interest after
manova:

Command            Description
-------------------------------------------------------------------------
manovatest         multivariate tests after manova
screeplot          plot eigenvalues
-------------------------------------------------------------------------

The following standard postestimation commands are also available:

Command            Description
-------------------------------------------------------------------------
contrast           contrasts and ANOVA-style joint tests of estimates
estat summarize    summary statistics for the estimation sample
estat vce          variance-covariance matrix of the estimators (VCE)
lincom             point estimates, standard errors, testing, and
inference for linear combinations of coefficients
margins            marginal means, predictive margins, marginal effects,
and average marginal effects
marginsplot        graph the results from margins (profile plots,
interaction plots, etc.)
nlcom              point estimates, standard errors, testing, and
inference for nonlinear combinations of coefficients
predict            predictions, residuals, and standard errors
predictnl          point estimates, standard errors, testing, and
inference for generalized predictions
pwcompare          pairwise comparisons of estimates
test               Wald tests of simple and composite linear hypotheses
testnl             Wald tests of nonlinear hypotheses
-------------------------------------------------------------------------

Syntax for predict

predict [type] newvar [if] [in] [, equation(eqno[, eqno]) statistic]

statistic          Description
-------------------------------------------------------------------------
Main
xb               xb, fitted values; the default
stdp             standard error of the fitted value
residuals        residuals
difference       difference between the linear predictions of two
equations
stddp            standard error of the fitted values for differences
-------------------------------------------------------------------------
These statistics are available both in and out of sample; type predict
... if e(sample) ... if wanted only for the estimation sample.

Statistics > Postestimation

Description for predict

predict creates a new variable containing predictions such as fitted
values, standard errors, residuals, and differences between the linear
predictions.

Options for predict

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

equation(eqno [, eqno]) specifies the equation to which you are
referring.

equation() is filled in with one eqno for the xb, stdp, and residuals
options.  equation(#1) would mean that the calculation is to be made
for the first equation (that is, for the first dependent variable),
equation(#2) would mean the second, and so on.  You could also refer
to the equations by their names.  equation(income) would refer to the
equation named income and equation(hours), to the equation named
hours.

If you do not specify equation(), results are the same as if you had
specified equation(#1).

difference and stddp refer to between-equations concepts.  To use
these options, you must specify two equations, for example,
equation(#1,#2) or equation(income,hours).  When two equations must
be specified, equation() is required.  With equation(#1,#2),
difference computes the prediction of equation(#1) minus the
prediction of equation(#2).

xb, the default, calculates the fitted values--the prediction of xb for
the specified equation.

stdp calculates the standard error of the prediction for the specified
equation (the standard error of the estimated expected value or mean
for the observation's covariate pattern).  The standard error of the
prediction is also referred to as the standard error of the fitted
value.

residuals calculates the residuals.

difference calculates the difference between the linear predictions of
two equations in the system.

stddp calculates the standard error of the difference in linear
predictions (x_{1j}b - x_{2j}b) between equations 1 and 2.

commands, see [R] predict.

Syntax for margins

margins [marginlist] [, options]

margins [marginlist] , predict(statistic ...) [predict(statistic ...)
...] [options]

statistic          Description
-------------------------------------------------------------------------
default            linear predictions for each equation
xb                 linear prediction for a specified equation
difference         difference between the linear predictions of two
equations
residuals          not allowed with margins
stdp               not allowed with margins
stddp              not allowed with margins
-------------------------------------------------------------------------
xb defaults to the first equation.

Statistics not allowed with margins are functions of stochastic
quantities other than e(b).

For the full syntax, see [R] margins.

Statistics > Postestimation

Description for margins

margins estimates margins of responses for linear predictions, fitted
values, and differences between the linear predictions.

Syntax for manovatest

manovatest term [term ...] [/ term [term ...]] [,
ytransform(matname)]

manovatest, test(matname) [ytransform(matname)]

manovatest , showorder

where term is a term from the termlist in the previously run manova.

Statistics > Multivariate analysis > MANOVA, multivariate regression, and
related > Multivariate tests after MANOVA

Description for manovatest

manovatest provides multivariate tests involving terms or linear
combinations of the underlying design matrix from the most recently fit
manova.  The four multivariate test statistics are Wilks's lambda,
Pillai's trace, Lawley-Hotelling trace, and Roy's largest root.  The
format of the output is similar to that shown by manova.

Options for manovatest

ytransform(matname) specifies a matrix for transforming the y variables
(the depvarlist from manova) as part of the test.  The multivariate
tests are based on inv(A*E*A')*(A*H*A').  By default, A is the
identity matrix.  ytransform() is how you specify an A matrix to be
used in the multivariate tests.  Specifying ytransform() provides the
same results as first transforming the y variables with Y*A', where Y
is the matrix formed by binding the y variables by column and A is
the matrix stored in matname; then performing the manova on the
transformed y's; and finally running manovatest without ytransform().

The number of columns of matname must equal the number of variables
in the depvarlist from manova.  The number of rows must be less than
or equal to the number of variables in the depvarlist from manova.
matname should have columns in the same order as the depvarlist from
manova.  The column and row names of matname are ignored.

When ytransform() is specified, a listing of the transformations is
presented before the table containing the multivariate tests.  You
should examine this table to verify that you have applied the
transformation you desired.

test(matname) is required with the second syntax of manovatest.  The rows
of matname specify linear combinations of the underlying design
matrix of the MANOVA that are to be jointly tested.  The columns
correspond to the underlying design matrix (including the constant if
it has not been suppressed).  The column and row names of matname are
ignored.

A listing of the constraints imposed by the test() option is
presented before the table containing the multivariate tests.  You
should examine this table to verify that you have applied the linear
combinations you desired.  Typing manovatest, showorder allows you to
examine the ordering of the columns for the design matrix from the
MANOVA.

showorder causes manovatest to list the definition of each column in the
design matrix.  showorder is not allowed with any other option or
when terms are specified.

Syntax for test

In addition to the standard syntax of test, test after manova also allows
the following.

test, test(matname) [mtest[(opt)] matvlc(matname)]               syntax A

test, showorder                                                  syntax B

syntax A    test expression involving the coefficients of the underlying
multivariate regression model; you provide information as a
matrix
syntax B    show underlying order of design matrix, which is useful when
constructing the matname argument of the test() option

Statistics > Multivariate analysis > MANOVA, multivariate regression, and
related > Wald test after MANOVA

Description for test

In addition to the standard syntax of test, test after manova has two
additionally allowed syntaxes; see below.  test performs Wald tests of
expressions involving the coefficients of the underlying regression
model.  Simple and composite linear hypotheses are possible.

Options for test

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

test(matname) is required with syntax A of test.  The rows of matname
specify linear combinations of the underlying design matrix of the
MANOVA that are to be jointly tested.  The columns correspond to the
underlying design matrix (including the constant if it has not been
suppressed).  The column and row names of matname are ignored.

A listing of the constraints imposed by the test() option is
presented before the table containing the tests.  You should examine
this table to verify that you have applied the linear combinations
you desired.  Typing test, showorder allows you to examine the
ordering of the columns for the design matrix from the MANOVA.

matname should have as many columns as the number of dependent
variables times the number of columns in the basic design matrix.
The design matrix is repeated for each dependent variable.

showorder causes test to list the definition of each column in the design
matrix.  showorder is not allowed with any other option.

+---------+
----+ Options +----------------------------------------------------------

mtest[(opt)] specifies that tests be performed for each condition
separately.  opt specifies the method for adjusting p-values for
multiple testing.  Valid values for opt are

bonferroni    Bonferroni's method
holm          Holm's method
sidak         Sidak's method

Specifying mtest without an argument is equivalent to specifying

The following option is available with test after manova but is not shown
in the dialog box:

matvlc(matname), a programmer's option, saves the variance-covariance
matrix of the linear combinations involved in the suite of tests.
For the test of H_0: L*b = c, what is returned in matname is L*V*L',
where V is the estimated variance-covariance matrix of b.

Examples

---------------------------------------------------------------------------
Setup
. webuse metabolic
. manova y1 y2 = group

Test group 1 versus groups 2, 3, and 4
. manovatest, showorder
. matrix c1 = (3,-1,-1,-1,0)
. manovatest, test(c1)

---------------------------------------------------------------------------
Setup
. webuse sorghum
. manova time1 time2 time3 time4 time5 = variety block
. matrix m1 = J(1,5,1)
. matrix m2 = (1,-1,0,0,0 \ 1,0,-1,0,0 \ 1,0,0,-1,0 \ 1,0,0,0,-1)
. manovatest, showorder
. mat c1 =
(1,-1,0,0,0,0,0,0,0,0\1,0,-1,0,0,0,0,0,0,0\1,0,0,-1,0,0,0,0,0,0)
. matrix c2 = (.25,.25,.25,.25,.2,.2,.2,.2,.2,1)

Test for equal variety marginal means
. manovatest, test(c1) ytransform(m1)

Test for equal time marginal means
. manovatest, test(c2) ytransform(m2)

Test variety by time interaction
. manovatest, test(c1) ytransform(m2)

---------------------------------------------------------------------------
Setup
. webuse biochemical
. manova y1 y2 y3 = group c.x1 c.x2

Test that the continuous covariates are jointly equal to zero
. manovatest c.x1 c.x2

--------------------------------------------------------------------------
Setup
. webuse biochemical
. manova y1 y2 y3 = group c.x1 c.x2 group#c.x1 group#c.x2

Test that the continuous covariates are jointly equal to zero across
groups
. manovatest group#c.x1 group#c.x2
---------------------------------------------------------------------------

Setup
. webuse jaw
. manova y1 y2 y3 = gender fracture gender#fracture

Compute the predicted mean (marginal mean), standard error, z statistic,
p-value, and confidence interval of y1 for each combination of fracture
and gender
. margins gender#fracture, predict(equation(y1))

Contrast women with men for every fracture type and every dependent
variable
. contrast gender@fracture#_eqns, mcompare(scheffe)
---------------------------------------------------------------------------

Stored results

manovatest stores the following in r():

Scalars
r(df)               hypothesis degrees of freedom
r(df_r)             residual degrees of freedom

Matrices
r(H)                hypothesis SSCP matrix
r(E)                residual-error SSCP matrix
r(stat)             multivariate statistics
r(eigvals)          eigenvalues of E^-1H
r(aux)              s, m, and n values

test after manova stores the following in r():

Scalars
r(p)                two-sided p-value
r(F)                F statistic
r(df)               hypothesis degrees of freedom
r(df_r)             residual degrees of freedom
r(drop)             0 if no constraints dropped, 1 otherwise
r(dropped_#)        index of #th constraint dropped

Macros
r(mtmethod)         method of adjustment for multiple testing

Matrices
r(mtest)            multiple test results

```