I have created my own phylogenetic tree as follows.
I am having trouble resolving the error no matter how I try.
Is there something wrong with the way I created it?
I want to use gls.ancova function in "evomap". Please help me!
newick_tree<-"(A:4,(B:2,(C:2.953469601,D:1.443532938):1.136357167):1.104667235);"
phylo_tree <- read.tree(text = newick_tree)
vcv(phylo_tree)
A B C D
A 4 0.000000 0.000000 0.000000
B 0 3.104667 1.104667 1.104667
C 0 1.104667 5.194494 2.241024
D 0 1.104667 2.241024 3.684557
gls.ancova(log_lifespan ~ body_size, vcv(phylo_tree), Model, Model_I)
Error in solve.default(Sigma) :
Lapack routine dgesv: system is exactly singular: U[1,1] = 0
indicates that the system of equations you're trying to solve is singular, meaning it doesn't have a unique solution. This typically happens when there is perfect multicollinearity in your data, i.e., one or more of your variables can be expressed as a linear combination of the others.
In the context of the gls.ancova()function, this could mean that one of your covariates is a perfect linear combination of the others, or that there is a variable that has a constant value.
To resolve this issue, you should check your data for multicollinearity. This can be done by examining correlation matrices or Variance Inflation Factors (VIFs). If you find a variable that is a perfect linear combination of others, or a variable that has a constant value, you should remove it from your model.