Learn R Programming

caper (version 1.0.3)

anova.caic: Anova and model checking methods for independent contrast models.

Description

These functions provide ANOVA tables and model comparison using ANOVA and AIC, along with standard model diagnostic plots and accessor functions for phylogenetic independent contrast objects.

Usage

# S3 method for caic
anova(object, ...)
# S3 method for caiclist
anova(object, ..., scale=0, test='F')
# S3 method for caic
logLik(object, ...)
# S3 method for caic
predict(object, ...)
# S3 method for caic
residuals(object, ...)
# S3 method for caic
coef(object, ...)
# S3 method for caic
plot(x, ...)

Arguments

object

An object of class 'caic'.

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.

x

An object of class 'caic'.

...

Further argument to be passed to methods.

Author

David Orme

Details

The 'anova' method provides access to single anova tables for a model and to comparison of lists of models. The 'logLik' method provides access to the log likelihood of the 'caic' model and hence to AIC comparison of models.

The 'plot' method uses the standard set of model diagnostic plots for linear models. It is also wise to check the evolutionary assumptions of independent contrast models using the 'caic' specific diagnostic plots. The 'predict' and 'residuals' functions provide access to these parts of the 'caic' object.

See Also

crunch, brunch,macrocaic,caic.diagnostics

Examples

Run this code
data(shorebird)
shorebird.data$lgEgg.Mass <- log(shorebird.data$Egg.Mass)
shorebird.data$lgM.Mass <- log(shorebird.data$M.Mass)
shorebird.data$lgF.Mass <- log(shorebird.data$F.Mass)
shorebird <- comparative.data(shorebird.tree, shorebird.data, Species)

cMod1 <- crunch(lgEgg.Mass ~ lgM.Mass * lgF.Mass, data=shorebird)
cMod2 <- crunch(lgEgg.Mass ~ lgM.Mass + lgF.Mass, data=shorebird)
cMod3 <- crunch(lgEgg.Mass ~ lgM.Mass , data=shorebird)

anova(cMod1, cMod2, cMod3)
AIC(cMod1, cMod2, cMod3)

plot(cMod3)

Run the code above in your browser using DataLab