anova.pgls | R Documentation |
The 'anova' function creates ANOVA tables for a 'pgls' models using sequential sums of squares.
## S3 method for class 'pgls'
anova(object, ...)
## S3 method for class 'pglslist'
anova(object, ..., scale = 0, test = "F")
object |
A 'pgls' model object. |
... |
Additional 'pgls' models. |
scale |
A character string specifying the test statistic to be used. Can be one of "F", "Chisq" or "Cp", with partial matching allowed, or NULL for no test. |
test |
numeric. An estimate of the noise variance sigma^2. If zero this will be estimated from the largest model considered. |
The sequential sums of squares are calculated by refitting the model in the order of the terms of the formula and so can take a little time to calculate. Branch length transformations are held at the values of the initial object. The 'logLik.pgls' provides a simple accessor function that allows the use of AIC model comparisons. Note that the generic AIC methods do no checking to ensure that sensible models are being compared.
A table of class 'anova' and 'data.frame' that employs the generic plot methods for 'anova' tables.
The functions build heavily on the generic methods 'anova.lm' and 'anova.lmlist'.
Rob Freckleton, David Orme
pgls
data(shorebird)
shorebird <- comparative.data(shorebird.tree, shorebird.data, Species, vcv=TRUE, vcv.dim=3)
mod1 <- pgls(log(Egg.Mass) ~ log(M.Mass) * log(F.Mass), shorebird)
anova(mod1)
mod2 <- pgls(log(Egg.Mass) ~ log(M.Mass) + log(F.Mass), shorebird)
mod3 <- pgls(log(Egg.Mass) ~ log(M.Mass) , shorebird)
mod4 <- pgls(log(Egg.Mass) ~ 1, shorebird)
anova(mod1, mod2, mod3, mod4)
AIC(mod1, mod2, mod3, mod4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.