pic.pgls {motmot} | R Documentation |
Fast PLGS estimation based on contrasts
Description
Estimates regression parameters for a phylogenetic generalised least-squares analysis using the fast constrasts method (Felsenstein 1973; 1985; Freckleton 2012). This implementation is applicable for continuous traits only and not factors
Usage
pic.pgls(
formula,
phy,
y,
lambda = "ML",
return.intercept.stat = FALSE,
meserr = NULL
)
Arguments
formula |
A model formula with continuous variables only |
phy |
An object of class |
y |
A matrix of trait values with rownames corresponding to the phy tip labels, and column names corresponding to the formula variable names |
lambda |
Default is "ML" meaning the phylogenetic signal of the response variable will be estimated using restricted Maximum likelihood. If a numeric value between 0-1 is provided this will be used in the calculation of regression coefficients |
return.intercept.stat |
Logical. If |
meserr |
A vector (or matrix) of measurement error for each tip. This is only applicable to univariate analyses. |
Value
A list containing the model, model summary, intercept, estimate of Lambda, model log-Likelihood, model AIC
Author(s)
Mark N Puttick and Rob Freckleton
See Also
Examples
# Data and phylogeny
data(anolis.tree)
anolis.tree$node.label <- NULL
lm.data <- transformPhylo.sim(phy=anolis.tree, n=2, model="bm")
dat <- data.frame(x = lm.data[,1], y = lm.data[,2],
names = anolis.tree$tip, row.names = anolis.tree$tip)
picModel <- pic.pgls(formula=y ~ x,
phy=anolis.tree, y = dat, lambda=1,
return.intercept.stat=FALSE)