Next: match() Up: MacAnova Help File Previous: makesymbols()   Contents


manova([Model] [,print:F or silent:T, coefs:F, pvals:T, fstats:T,\
  byvar:T, sssp:F or T]), Model a CHARACTER scalar

Keywords: glm, multivariate analysis, anova
manova(Model) computes a MANOVA table of SS/SP (sums of squares and sums
of products) matrices for the model in the CHARACTER variable Model.
The response variable should be a matrix with rows as cases and columns
the variables.

Type 'help(models)' for information on how to specify Model.

If the response is univariate (has only one column), manova() is
equivalent to anova().

Unless 'marginal:T' is an argument, SS/SP matrices are computed
sequentially (so called SAS Type I quantities).

Normally, when each row of a SS/SP matrix will fit on a single line, all
matrices are printed in their entirety.  When a row would require more
than one line, only the term names and the degrees of freedom are
printed.  This behavior can be modified by keywords 'sssp', 'byvar',
'fstats' and 'pvals'; see below.  In any case the matrices are saved in
the three-dimensional side effect array SS, with the first subscript
indexing terms and with the first dimension labeled by TERMNAMES.

manova(Model,weights:Wts) does a weighted analysis.  Wts must be a REAL
vector with Wts[i] >= 0 and nrows(Wts) = nrows(response).  The results
are the same as if the i-th row of the response and all X-variables
(variates and dummy variables and their products), including the
constant vector were multiplied by sqrt(Wts[i]) and a least squares fit
(without an intercept) computed.

manova() or manova(,weights:Wts) (no model supplied) uses the model used
by the most recent GLM command such as manova(), anova(), or poisson().
See topic 'glm'.

Side effect variables created are RESIDUALS, HII, DF, SS, DEPVNAME,
TERMNAMES, and STRMODEL.  When weights are specified, RESIDUALS =
Response - Fitted and WTDRESIDUALS = sqrt(Wts)*RESIDUALS is an
additional side effect vector.  You should use WTDRESIDUALS rather than
RESIDUALS in residual plots or other diagnostic procedures.

SS is a 3-dimensional array such that SS[j,,] is the sum of squares and
products matrix for term j.  If the appropriate error matrix for the
k-th term is SS[j,,], the eigenvalues needed for several standard tests
(Wilks, Roy, Pillai, Hotelling generalized T-squared) may be computed by
releigenvals(SS[j,,],SS[k,,]) or you can compute some test statistics
directly, for example,
  Cmd> T2 <- dferror*trace(solve(SS[k,,],SS[j,,])
  Cmd> lambda <- det(SS[j,,])/det(SS[k,,]+SS[j,,]).

                          Other Keywords
Keyword phrase  Default  Meaning
  byvar:T          F     Computes a complete ANOVA table for each
                         variable.  The full SS/SP matrices are not
                         printed although they are still available in
                         array SS.

  sssp:T         none    Forces the printing of the full SS/SP matrices,
                         even when each row would require more than one
                         line.  This option is ignored with any of
                         fstats:T, pvals:T, or byvar:T.
  sssp:F                 Suppresses printing of the full SS/SP matrices,
                         even if a row would fit on a single line.  Only
                         the term names and degrees of freedom are

See topic 'glm_keys' for information on keyword phrases 'print:F',
'silent:T', 'fstats:T', 'pvals:T', 'coefs:F' and 'marginal:T'.

When byvar:T is an argument, options (not keywords) 'fstats' and 'pvals'
have the same effect as with anova().  If byvar:T is not an argument,
these options are ignored.  See topics 'options' and 'glm_keys'.

When byvar:T is not an argument, options 'fstats' and 'pvals' are
ignored.  If either 'fstats:T' or 'pvals:T' is an argument, univariate
SS and MS are printed for each variable and term, together with F-
statistics and/or P values .  The information is essentially the same as
with byvar:T except that all the statistics for a term are grouped
together.  The full SS/SP matrices are not printed but are available in
array SS.

Functions contrast(), coefs(), predtable(), and cellstats() work after a

Gary Oehlert 2003-01-15