Caetanods / ratematrix

Bayesian estimation of the evolutionary rate matrix.
9 stars 3 forks source link

missing data? #52

Open jakeberv opened 2 years ago

jakeberv commented 2 years ago

Hi Daniel --

How does ratematrix handle missing data? Are NAs allowed in the input data?

Thanks, Jacob Berv

Caetanods commented 2 years ago

Hello! Sorry for a very belated answer on this!

At the moment the ratematrix package cannot deal with NA values. My suggestion is to fit a single trait BM model to the trait that you have NA values, then you can simulate a trait value for that species using the estimated parameters for the model. Because the inputted trait value is sampled from the estimated model, it will likely not influence in the estimate of the multivariate model of trait evolution. Of course, when analyzing the results, remember not to make biological conclusions dependent on the generated trait value.

This will work fine if you have just a single trait value missing for that species. If you have many trait values missing for a particular species, then it might be best to remove it from the analysis.