pgls.iter {mmodely}R Documentation

Iterate through PGLS estimations

Description

This function takes phylogenetic tree and a list of (all possible) combinations of variables as a vector of model strings and estimates PGLS fits based on the bounds or tree parameters provided seperately.

Usage

pgls.iter(models, phylo, df,  gs.clmn='gn_sp', 
          b=list(lambda=c(.2,1),kappa=c(.2,2.8),delta=c(.2,2.8)),l='ML', k='ML',d='ML') 

Arguments

models

a vector of all possible model formulas (as character strings)

phylo

a phylogenetic tree

df

the name of the column used to specify 'Genus_species'

gs.clmn

the name of the column containing the 'Genus_species' vector

b

a list of vectors of upper and lower bounds for kappa, lambda, and delta

k

the fixed or 'ML' value for kappa

l

the fixed or 'ML' value for lambda

d

the fixed or 'ML' value for delta

Value

a list of fit PGLS regression models plus 'optim' and 'param' support tables

Examples



data.path <- system.file("extdata","primate-example.data.csv", package="mmodely")
data <- read.csv(data.path, row.names=1)
pvs <- names(data[3:5])
data$gn_sp <- rownames(data)

tree.path <- system.file("extdata","primate-springer.2012.tre", package="mmodely")
phyl <- ape::read.tree(tree.path)[[5]]

comp <- comp.data(phylo=phyl, df=data)

mods <- get.model.combos(predictor.vars=pvs, outcome.var='OC', min.q=2)

PGLSi <- pgls.iter(models=mods, phylo=phyl, df=data, k=1,l=1,d=1) 


[Package mmodely version 0.2.5 Index]