pairwise.contrasts: Pairwise contrasts

View source: R/multivariate.stat.r

pairwise.contrastsR Documentation

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

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.

Value

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

Note

The function assumes "effect" dummy coding for the factor levels (see ?contr.treatment)

Author(s)

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


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


mvMORPH documentation built on March 31, 2023, 6:25 p.m.