mvlm
is used to fit linear models with a multivariate outcome. It uses
the asymptotic null distribution of the multivariate linear model test
statistic to compute p-values (McArtor et al., under review). It therefore
alleviates the need to use approximate p-values based Wilks' Lambda, Pillai's
Trace, the Hotelling-Lawley Trace, and Roy's Greatest Root.
mvlm(formula, data, start.acc = 1e-20, n.cores = 1, contr.factor = "contr.sum", contr.ordered = "contr.poly")
formula
where the outcome (e.g. the
Y in the following formula: Y ~ x1 + x2) is a n x q matrix
, where
q
is the number of outcome variables being regressed onto the set
of predictors included in the formula.data.frame
containing all of the predictors
passed to formula
.davies
function in the CompQuadForm
package (Duchesne & De Micheaux, 2010) that mvlm
uses to compute
multivariate linear model p-values.parallel
pacakge.factor
. Must be a string taking one of the
following values: ("contr.sum", "contr.treatment", "contr.helmert")
.ordered
. Must be a string taking one of the
following values: ("contr.poly", "contr.sum", "contr.treatment",
"contr.helmert")
.summary(mvlm.res)
produces a data frame comprised of:
produces a data frame comprised of:In addition to the information in the three columns comprising
summary(mvlm.res)
, the mvlm.res
object also contains:Note that the printed output of summary(res)
will truncate p-values
to the smallest trustworthy values, but the object returned by
summary(mvlm.res)
will contain the p-values as computed. If the error
bound of the Davies algorithm is larger than the p-value, the only conclusion
that can be drawn with certainty is that the p-value is smaller than (or
equal to) the error bound.
formula
must be a matrix
, and the
object passed to data
must be a data frame containing all of the
variables that are named as predictors in formula
.The conditional effects of variables of type factor
or ordered
in data
are computed based on the type of contrasts specified by
contr.factor
and contr.ordered
. If data
contains an
(ordered or unordered) factor with k
levels, a k-1
degree of
freedom test will be conducted corresponding to that factor and the specified
contrast structure. If, instead, the user wants to assess k-1
separate
single DF tests that comprise this omnibus effect (similar to the approach
taken by lm
), then the appropriate model matrix should be formed in
advance and passed to mvlm
directly in the data
parameter. See
the package vigentte for an example by calling
vignette('mvlm-vignette')
.
Duchesne, P., & De Micheaux, P.L. (2010). Computing the distribution of quadratic forms: Further comparisons between the Liu-Tang-Zhang approximation and exact methods. Computational Statistics and Data Analysis, 54(4), 858-862.
McArtor, D. B., Lubke, G. H., & Bergeman, C. S. (under review). The null distribution of the multivariate linear model test statistic. Manuscript submitted for publication.
data(mvlmdata)
Y <- as.matrix(Y.mvlm)
# Main effects model
mvlm.res <- mvlm(Y ~ Cont + Cat + Ord, data = X.mvlm)
summary(mvlm.res)
# Include two-way interactions
mvlm.res.int <- mvlm(Y ~ .^2, data = X.mvlm)
summary(mvlm.res.int)
Run the code above in your browser using DataLab