View source: R/multivariate.stat.r
pairwise.contrasts | R Documentation |
Generates pairwise contrasts (for factor levels) from an object fitted by the mvgls
or mvols
function. This function is used internally in pairwise.glh
for the generalized linear hypothesis tests (see also ?manova.gls).
pairwise.contrasts(object, term=1, ...)
object |
A model fit obtained by the |
term |
The factor term in the "object" model fit for which all the pairwise contrasts are built. |
... |
Further arguments to be passed through. Not used. |
Returns a matrix of contrasts for all the pairwise comparisons between levels of "term".
The function assumes "effect" dummy coding for the factor levels (see ?contr.treatment)
J. Clavel
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
,
manova.gls
,
pairwise.glh
data("phyllostomid")
# model fit with mandible~"grp2"
fit <- mvgls(mandible~grp2, data=phyllostomid, phyllostomid$tree, model="lambda", method="PL")
# pairwise tests - note that the first group in lexicographic order (the "intercept") is
# considered as the baseline in R
pairwise.contrasts(fit, term="grp2")
# We can explicitly estimate each mean (rather than deviations to the baseline)
fitb <- mvgls(mandible~grp2 + 0, data=phyllostomid, phyllostomid$tree, model="lambda", method="PL")
pairwise.contrasts(fitb, term="grp2")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.