pgls-methods: Generic model methods for 'pgls' models.

pgls-methodsR Documentation

Generic model methods for 'pgls' models.

Description

These are simple summary methods, accessor functions and summary and print methods for 'pgls' models.

Usage

## S3 method for class 'pgls'
coef(object, ...)
## S3 method for class 'pgls'
residuals(object, phylo = FALSE, ...)
## S3 method for class 'pgls'
fitted(object, ...)
## S3 method for class 'pgls'
predict(object, newdata, ...)
## S3 method for class 'pgls'
summary(object, ...)
## S3 method for class 'pgls'
print(x, digits = max(3, getOption("digits") - 3), ...)
## S3 method for class 'summary.pgls'
print(x, digits = max(3, getOption("digits") - 3), ...)
## S3 method for class 'pgls'
nobs(object, ...)

Arguments

object

An object of class 'pgls'.

x

An object of class 'pgls'.

phylo

Return phylogenetically corrected residuals or ordinary residuals (see details).

newdata

Alternative data for predicting from 'pgls' models.

digits

Number of digits to show in summary methods.

...

Further arguments to methods.

Details

Phylogenetically corrected residuals from 'pgls' models [TODO].

Note that the r^2 values reported by summary.pgls have a specific interpretation. pgls fits the intercept-only model for the data using _exactly_ the same covariance matrix (phylogeny plugged through any branch length transformations) as the fitted model to get a null model. The r-squared and adjusted r-squared that are reported therefore hold the covariance matrix constant, so show percentage of variance explained between a null model and the actual model given that precise model of trait change.

The actual ML null model for the data (optimising the BL transformation independently) might be different from this - but then the r squared values confound change in explanatory power from changing the model parameters and from changing the trait model.

Value

The 'summary' method returns an object of class 'summary.pgls' containing:

call

The original function call creating the model.

df

A vector of the degrees of freedom used to estimate parameters and the residual degrees of freedom.

sigma

The square root of the estimated variance of the random error.

residuals

The phylogenetically corrected residuals.

coefficients

A table of model coefficient, standard errors and t values.

param

A vector of branch length parameters used in the model.

mlVals

A vector showing which branch length parameters have been optimised.

param.CI

A list of length three containing confidence intervals and p values on parameter bounds for each parameter.

fstatistic

A vector of the F value, numerator and denominator degrees of freedom for the model.

r.squared

The r^2 for the model.

adj.r.squared

The adjusted r^2 for the model.

Author(s)

Rob Freckleton, David Orme

See Also

pgls

Examples

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) 
print(mod1)

mod1.sum <- summary(mod1)
print(mod1.sum)

caper documentation built on Sept. 26, 2023, 5:10 p.m.