Phyloinformatics Summer of Code 2008/ecophylodemo
Phylogenetic Bipartite Linear Model Description Fits a linear model to the association strengths of a bipartite data set with or without phylogenetic correlation among the interacting species
Usage pblm(assocs,tree1=NULL,tree2=NULL,covars1=NULL,covars2=NULL,bootstrap=FALSE,nreps=10,maxit=10000,pstart=c(.5,.5)) pblmpredict(x,tree1.w.novel=NULL,tree2.w.novel=NULL,predict.originals=FALSE)
Arguments assocs A matrix of association strengths among two sets of interacting species tree1 A phylo tree object or a phylogenetic covariance matrix for the rows of assocs tree2 A phylo tree object or a phylogenetic covariance matrix for the columns of assocs covars1 A matrix of covariates (e.g., traits) for the row species of assocs covars2 A matrix of covariates (e.g., traits) for the column species of assocs bootstrap logical, bootstrap confidence intervals of the parameter estimates nreps Number of bootstrap replicated data sets to estimate parameter CIs maxit as in optim pstart starting values of the two phylogenetic signal strength parameters passed to optim x object of class pblm tree1.w.novel A phylo tree object or a phylogenetic covariance matrix which corresponds to tree1 of x with species to predict associations tree2.w.novel A phylo tree object or a phylogenetic covariance matrix which corresponds to tree2 of x with species to predict associations predict.originals if TRUE then the associations of each original species in the two phylogenies is predicted
Details Fit a linear model with covariates using estimated generalized least squares to the association strengths between two sets of interacting species. Associations can be either binary or continuous. If phylogenies of the two sets of interacting species are supplied, two phyogenetic signal strength parameters (d1 and d2), one for each species set, based on an Ornstein-Uhlenbeck model of evolution with stabilizing selection are estimated. Values of d=1 indicate no stabilizing selection and correspond to the Brownian motion model of evolution; 0<d<1 represents stabilizing selection; d=0 depicts the absence of phylogenetic correlation (i.e., a star phylogeny); and d>1 corresponds to disruptive selection where phylogenetic signal is amplified. Confidence intervals for these and the other parameters can be estimated with bootstrapping.
The function pblmpredict predicts the associations of novel species following the methods given in appendix B of Ives and Godfray (2006).
Value MSE total, full (each d estimated), star (d=0), and base (d=1) mean squared errors signal.strength two estimates of phylogenetic signal strength coefficients estimated intercept and covariate coefficients with approximate 95 percent CIs for the three model types (full, star, base) CI.boot 95 percent CIs for all parameters variates matrix of model variates (can be used for plotting) residuals matrix of residuals from the three models (full, star and base) predicted predicted associations bootvalues matrix of parameters estimated from the nreps bootstrap replicated data sets used to calculate CIs phylocovs phylogenetic covariance matricies scaled by the estimated d1 and d2 cors.1 correlations among predicted and observed associations for species of tree1, NA if predict.originals=FALSE cors.2 correlations among predicted and observed associations for species of tree2, NA if predict.originals=FALSE pred.novels1 predicted associations for the novel speices of tree1 pred.novels2 predicted associations for the novel speices of tree2
Note Covariates that apply to both species sets (e.g., sampling site) should be supplied in the covariate matrix of the set with the most species.
Bootstrapping CIs is slow due to the function optim used to estimate the model parameters. See appendix A in Ives and Godfray (2006) for a discussion about this boostrapping procedure
If pblmpredict=TRUE the function does not first remove each species in turn when predicting the associations of the original species as is done in Ives and Godfray (2006).
Author(s) Matthew Helmus firstname.lastname@example.org