View source: R/multivariate.stat.r
pairwise.glh | R Documentation |
Performs pairwise multivariate tests (e.g. "Pillai") on levels of a factor in a model fitted by the mvgls
or mvols
function. This is achieved by evaluating all the pairwise contrasts using generalized linear hypothesis tests (see also ?manova.gls).
pairwise.glh(object, term=1, test=c("Pillai", "Wilks", "Hotelling-Lawley", "Roy"),
adjust="holm", nperm=1000L, ...)
object |
A model fit obtained by the |
term |
The factor term in the "object" model fit on which the pairwise tests should be evaluated. |
test |
The multivariate test statistic to compute - "Wilks", "Pillai", "Hotelling-Lawley", or "Roy" |
adjust |
The multiple comparison adjustment. See |
nperm |
The number of permutations used for building the null distribution of the chosen statistic. Permutation is the only available approach for high-dimensional PL models, but either permutations or parametric tests can be used with maximum likelihood (method "LL" in |
... |
Further arguments to be passed through. (e.g., |
pairwise.glh
allows performing multivariate tests (e.g. Pillai's, Wilks, Hotelling-Lawley and Roy largest root) on generalized least squares (GLS) linear model (objects of class "mvgls") fit by either maximum likelihood (method="LL"
) or penalized likelihood (method="PL-LOO"
) using the mvgls
or mvols
function.
General Linear Hypothesis of the form:
\bold{LB=O}
is used internally with an L matrix specifying linear combinations ("contrasts") of the model coefficients (B) for each pairwise comparisons. The right-hand-side matrix O is a constant matrix (of zeros by default) that can be provided through the argument rhs
(to test specific values for instance).
Permutations on high-dimensional datasets is time consuming. You can use the option nbcores
to parallelize the computations over several cores using forking in UNIX platforms (default is nbcores=1L
). Estimated time to completion is displayed when verbose=TRUE
.
An object of class 'pairs.mvgls' which is usually printed. It contains a list including the following components:
test |
the multivariate test statistic used |
L |
the contrasts used for all the pairwise tests |
stat |
the statistic calculated for each pairwise comparisons |
pvalue |
the p-values calculated for each pairwise comparisons |
adjust |
the adjusted (for multiple comparisons) p-values calculated for each pairwise comparisons |
For PL methods, only the "RidgeArch" penalty is allowed for now. Due to corrections for multiple comparisons, one should ensure that the number of permutations is large enough.
J. Clavel
Clavel, J., Aristide, L., Morlon, H., 2019. A Penalized Likelihood framework for high-dimensional phylogenetic comparative methods and an application to new-world monkeys brain evolution. Systematic Biology 68(1): 93-116.
Clavel, J., Morlon, H. 2020. Reliable phylogenetic regressions for multivariate comparative data: illustration with the MANOVA and application to the effect of diet on mandible morphology in phyllostomid bats. Systematic Biology 69(5): 927-943.
mvgls
,
mvols
,
pairwise.contrasts
,
manova.gls
data("phyllostomid")
# model fit with mandible~"grp2"
fit <- mvgls(mandible~grp2, data=phyllostomid, phyllostomid$tree, model="lambda", method="PL")
# pairwise tests
pairwise.glh(fit, term="grp2", test="Pillai", adjust="holm", nperm=1000, verbose=TRUE)
# fit the model by ML (p<n) and use parametric tests
fitb <- mvgls(mandible[,1:5]~grp2, data=phyllostomid,
phyllostomid$tree, model="lambda", method="LL")
pairwise.glh(fitb, term="grp2", test="Pillai", adjust="holm", verbose=TRUE)
# use permutations on ML fit
pairwise.glh(fitb, term="grp2", test="Pillai", adjust="holm", nperm=1000, parametric=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.