GithubHelp home page GithubHelp logo

es-sim's Introduction

INTRODUCTION

Code used for testing trait-dependent diversification using tip rate correlation (TRC).

LICENSE

The code within this repository is available under a 3-clause BSD license. See the License.txt file for more information.

CITATION

If you use this pipeline for your own research, please cite:

  • Harvey, MG and Rabosky, DL. 2018. Continuous traits and speciation rates: Alternatives to state-dependent diversification models. Methods in Ecology and Evolution 9: 984-993. (link)

You can also provide a link to this repository if desired:

https://github.com/mgharvey/ES-sim

USAGE

Code used for simulating and analyzing the data in Harvey and Rabosky (in press) are included in the directory ./R/ and the simulated datasets examined are in the directory ./data/.

Requirements:

For now, simply download essim.R from the ./R/ directory of this repository, then load it in R:

source("essim.R")

Run it using the command

essim(phy, trait, nsim = 1000)

where "phy" is your phylogeny, "trait" is a vector containing your trait information (with names that match the names on the tips of your phylogeny), and "nsim" is the number of simulations used to build the null distribution of trait-speciation associations for significance testing. There are also optional arguments "return.es", which if "True" returns a named list of log inverse equal splits values, and "es", which can be used to supply an existing named vector of inverse equal splits values. The test assumptions are the same as for fitting a Brownian motion model to phylogenetic comparative data - that your data fit a multivariate normal distribution with the trait covariance between tips determined by the amount of time they have shared a common ancestor. The test will return the Pearson's correlation coefficient (rho), the simulation-based two-tailed p-value, and optionally the named list of log inverse equal splits statistic values for all tips.

DOI

DOI

es-sim's People

Contributors

josephwb avatar mgharvey avatar

Stargazers

Rhett M. Rautsaw avatar Melisa_vl avatar Nussaibah Raja-Schoob avatar Angelo avatar Miao Sun avatar Martin O'Neill avatar  avatar

Watchers

 avatar

es-sim's Issues

Error: not enough finite observations

Dear Sir,

I'm trying to do analysis with ES-sim but the program shows several errors. I have 112 taxa with continuous trait information

essimRes <-essim(dr_diptree,dsh, nsim = 1000, mes)

Error in cor.test.default(es, trait, method = "pearson") : 
  not enough finite observations
Called from: cor.test.default(es, trait, method = "pearson")

esm_pgls<- espgls(dr_diptree, dsh)

Error in data.frame(names(trait), trait, log(is[as.vector(names(trait))])) : 
  arguments imply differing number of rows: 0, 112
Called from: data.frame(names(trait), trait, log(is[as.vector(names(trait))]))

I'm unable to understand what is going wrong here, as I already successfully used the same dataset in different programs.
This is a humble request that it will be an immense help if someone kindly corrects me.

Thanks
Debajyoti

Failing analyses

For various data sets I am getting the following error:

Error in eigen(sigma, symmetric = TRUE) : 
  infinite or missing values in 'x'

Could this be because the data are not distributed as assumed? Here is one failing data set:
trait
But some other "standard" data sets (e.g. body size) fail as well. To be clear, there are no missing data.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.