Learn R Programming

mvMORPH (version 1.2.1)

pairwise.contrasts: Pairwise contrasts

Description

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).

Usage

pairwise.contrasts(object, term=1, ...)

Value

Returns a matrix of contrasts for all the pairwise comparisons between levels of "term".

Arguments

object

A model fit obtained by the mvgls or mvols function.

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.

Author

J. Clavel

References

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.

See Also

mvgls, mvols, manova.gls, pairwise.glh

Examples

Run this code
# \donttest{
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") 
# }

Run the code above in your browser using DataLab