Learn R Programming

phylolm (version 2.1)

phyloglm: Phylogenetic Generalized Linear Model

Description

Fits the phylogenetic logistic regression described in Ives and Garland (2010). The computation uses an algorithm that is linear in the number of tips in the tree.

Usage

phyloglm(formula, data, phy, method = c("MPLE","IG10"), btol = 10,
         log.alpha.bound = 4, start.beta=NULL, start.alpha=NULL)

Arguments

formula
a model formula.
data
a data frame containing variables in the model. If not found in data, the variables are taken from the current environment.
phy
a phylogenetic tree of type phylo with branch lengths.
method
The "IG10" method optimizes a GEE approximation to the penalized likelihood. "MPLE" maximizes the penalized likelihood. In both cases, the penalty is Firth's correction.
btol
bound on the linear predictor to bound the searching space.
log.alpha.bound
bound for the log of the parameter alpha
start.beta
starting values for beta coefficients
start.alpha
starting values for alpha (phylogenetic correlation)

Value

  • coefficientsthe named vector of coefficients.
  • alphathe phylogenetic correlation parameter.
  • sdstandard deviation for the regression coefficients, given the phylogenetic correlation parameter $\alpha$.
  • vcovcovariance matrix for the regression coefficients, given the phylogenetic correlation parameter.
  • logLiklog likelihood
  • aicAIC
  • penlogLikpenalized log likelihood, using Firth's penalty for coefficients
  • yresponse
  • nnumber of observations (tips in the tree)
  • dnumber of dependent variables
  • formulathe model formula
  • callthe original call to the function
  • methodthe estimation method
  • convergenceAn integer code with '0' for successful optimization. With MPLE, this is the convergence code from the optim routine.

encoding

latin1

Details

This function uses an algorithm that is linear in the number of tips in the tree.

References

Ho, L. S. T. and An�, C. "A linear-time algorithm for Gaussian and non-Gaussian trait evolution models". Systematic Biology 63(3):397-408.

Ives, A. R. and T. Garland, Jr. 2010. "Phylogenetic logistic regression for binary dependent variables". Systematic Biology 59:9-26.

Examples

Run this code
set.seed(123456)
tre = rtree(50)
x = rTrait(n=1,phy=tre)
X = cbind(rep(1,50),x)
y = rbinTrait(n=1,phy=tre, beta=c(-1,0.5), alpha=1 ,X=X)
dat = data.frame(trait01 = y, predictor = x)
fit = phyloglm(trait01~predictor,phy=tre,data=dat)
summary(fit)
coef(fit)
vcov(fit)

Run the code above in your browser using DataLab