PGLS_fossil {RRphylo}R Documentation

Phylogenetic Generalized Least Square with phylogenies including fossils

Description

The function performs pgls for non-ultrametric trees using a variety of evolutionary models or RRphylo rates to change the tree correlation structure.

Usage

PGLS_fossil(modform,data=NULL,tree=NULL,RR=NULL,GItransform=FALSE,
  intercept=FALSE,model="BM",method=NULL,permutation="none",...)

Arguments

modform

the formula for the regression model.

data

a data.frame or list including response and predictor variables as named in modform. If not found in data, the variables are taken from current environment.

tree

a phylogenetic tree to be indicated for any model except if RRphylo is used to rescale tree branches. The tree needs not to be ultrametric and fully dichotomous.

RR

the result of RRphylo performed on the response variable. If RR is specified, tree branches are rescaled to the absolute branch-wise rate values calculated by RRphylo to transform the variance-covariance matrix.

GItransform

logical indicating whether the PGLS approach as in Garland and Ives (2000) must be applied.

intercept

under GItransform = TRUE, indicates whether the intercept should be included in the model.

model

an evolutionary model as indicated in phylolm (for univariate response variable) or mvgls (for multivariate response variable).

method

optional argument to be passed to phylolm (for univariate response variable) or mvgls (for multivariate response variable). See individual functions for further details.

permutation

passed to manova.gls

...

further argument passed to phylolm, mvgls, manova.gls, or lm.

Details

The function is meant to work with both univariate or multivariate data, both low- or high-dimensional. In the first case, PGLS_fossil uses phylolm, returning an object of class "phylolm". In the latter, regression coefficients are estimated by mvgls, and statistical significance is obtained by means of permutations within manova.gls. In this case, PGLS_fossil returns a list including the output of both analyses. In all cases, for both univariate or multivariate data, if GItransform = TRUE the functions returns a standard lm output. In the latter case, the output additionally includes the result of manova applied on the multivariate linear model.

Value

Fitted pgls parameters and significance. The class of the output object depends on input data (see details).

Author(s)

Silvia Castiglione, Pasquale Raia, Carmela Serio, Gabriele Sansalone, Giorgia Girardi

References

Garland, Jr, T., & Ives, A. R. (2000). Using the past to predict the present: confidence intervals for regression equations in phylogenetic comparative methods. The American Naturalist, 155: 346-364. doi:10.1086/303327

See Also

RRphylo vignette; mvgls ; manova.gls ;phylolm

Examples

## Not run: 
library(ape)
library(phytools)
cc<- 2/parallel::detectCores()

rtree(100)->tree
fastBM(tree)->resp
fastBM(tree,nsim=3)->resp.multi
fastBM(tree)->pred1
fastBM(tree)->pred2

PGLS_fossil(modform=resp~pred1+pred2,tree=tree)->pgls_noRR
PGLS_fossil(modform=resp~pred1+pred2,tree=tree,GItransform=TRUE)->GIpgls_noRR

RRphylo(tree,resp,clus=cc)->RR
PGLS_fossil(modform=resp~pred1+pred2,tree=tree,RR=RR)->pgls_RR
PGLS_fossil(modform=resp~pred1+pred2,tree=tree,RR=RR,GItransform=TRUE)->GIpgls_RR

# To derive log-likelihood and AIC for outputs of PGLS_fossil applied on univariate
# response variables the function AIC can be applied
AIC(pgls_noRR)
AIC(pgls_RR)
AIC(GIpgls_noRR)
AIC(GIpgls_RR)


PGLS_fossil(modform=resp.multi~pred1+pred2,tree=tree)->pgls2_noRR
PGLS_fossil(modform=resp.multi~pred1+pred2,tree=tree,GItransform=TRUE)->GIpgls2_noRR

# To evaluate statistical significance of multivariate models, the '$manova'
# object must be inspected
pgls2_noRR$manova
summary(GIpgls2_noRR$manova)

RRphylo(tree,resp.multi,clus=cc)->RR
PGLS_fossil(modform=resp.multi~pred1+pred2,tree=tree,RR=RR)->pgls2_RR
PGLS_fossil(modform=resp.multi~pred1+pred2,tree=tree,RR=RR,GItransform=TRUE)->GIpgls2_RR

# To evaluate statistical significance of multivariate models, the '$manova'
# object must be inspected
pgls2_noRR$manova
summary(GIpgls2_noRR$manova)
pgls2_RR$manova
summary(GIpgls2_RR$manova)

logLik(pgls2_noRR$pgls)
logLik(pgls2_RR$pgls)

## End(Not run)

[Package RRphylo version 2.8.0 Index]