pic.pgls: Fast PLGS estimation based on contrasts

Description Usage Arguments Value Author(s) See Also Examples

View source: R/pic.pgls.R

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

1
2
3
4
5
6
7
8
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 phylo (see ape).

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 TRUE the standard errors, t value, and p value of the estimated Intercept is provided for comparison with output from pgls from caper etc.,. Default is FALSE as this slows the function as it involves constructing and calculating the inverse of the phy variance-covariance matrix, and based on contrasts the design matrix column of ones would have zero contrasts.

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

pgls

Examples

1
2
3
4
5
6
7
8
9
# 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)

motmot documentation built on Jan. 11, 2020, 9:15 a.m.