I'm trying to run an MCMCglmm using a pedigree to control for phylogeny. I downloaded the tree from birdtree.org and imported it into R using read.nexus. When I run the MCMCglmm it gives me the following error:

Error in inverseA(pedigree = pedigree, scale = scale, nodes = nodes) : 
  some phylogeny edge.lengths are zero

Some of the edge lengths are 0 because it is comparing a bird to itself so there is no genetic distance within the same species. Is there a way around this? Can I somehow delete the 0's from the dataset while still retaining all the other information. Let me know if I need to provide more information.

Actually I just printed the data and there are no 0's:

    [1] 50.3118845  5.8009460  2.2576440 26.1498900 16.1034045  1.0518025 15.0516020 15.0516020  5.1576210 37.0956735 37.0956735  0.9360845  4.8883660
    [14] 22.2703965  1.6615105 14.7545810  1.0205180 13.7340630 13.7340630  6.1036230 10.3124685 10.3124685  9.1451225 29.5413655  3.6932670 25.8480985
    [27]  7.9352645 17.9128340 17.9128340 16.3613985 27.2134555  8.1738990  4.3168675 -0.2584520  2.1596660  1.7616380  8.2655045  2.7943325  2.7943325
    [40] 11.0598370 12.8214750  7.0224640  7.9586770  7.9586770  0.4993570 11.5628230  2.6605090  2.6605090 14.2233320  7.9514520  1.8619850  4.0394170
    [53]  5.1867025  5.1867025  0.3112005  8.9149190  8.9149190 11.08810

Could it be the negative value?

  • $\begingroup$ When you say "length," I think "distance." Are these values distances (in the sense that it is nonnegative, satisfies the triangle inequality and d(x,x)=0)? If so, the negative value is invalid. $\endgroup$
    – Sycorax
    Nov 19, 2015 at 3:10
  • $\begingroup$ As I understand it all the values should be positive since they represent a genetic distance from each other and it's impossible to have a negative genetic distance. I don't understand why the negative value is there since it's just an imported tree. $\endgroup$ Nov 19, 2015 at 3:16
  • $\begingroup$ Best practice when you have an invalid value is to find out why it's invalid. This means considering eveything from someone doing addition wrong (I do this daily) to asking whether the minus sign a typo. Did a bit get flipped when you downloaded the file? If you can't reconstruct the data correctly and the maintainer is unreachable, you'll need to make a choice about whether to simply ignore the value (casewise deletion) or attempt to impute the true value. Imputation and missing data is its own field in statistics. $\endgroup$
    – Sycorax
    Nov 19, 2015 at 3:19
  • $\begingroup$ Looks like one of the relationships on the tree I downloaded goes backwards. Not sure how to fix this but I'll look around for some solutions. $\endgroup$ Nov 19, 2015 at 3:31
  • $\begingroup$ Well... If "backwards" means that it's negative, then it's not a distance metric! $\endgroup$
    – Sycorax
    Nov 19, 2015 at 4:06


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.