I am new to PGLS analysis and trying to run it on tree root trait data in the nlme library. I have imported the phylogenetic tree into R and used the drop.tip function to match the tree data to the species data by running this code
tree <- read.tree("species-tree for Daniel Laughlin.nwk")
droptip = c("Syzygium_maire","Plagianthus_regius","Cyathea_smithii")
tree <- drop.tip(tree, droptip, trim.internal = TRUE)
The treet root trait data has 63 observations with 30 variables. When I focus my first PGLS on the four core root traits in the root economic space as independent variables and the root decomposition rate as the dependant variable, I was able to run the PGLS analysis successfully. However, the root chemistry data (e.g.,lignin) has some missing data which necessitate dropping observations with missing data before considering other traits for the analysis. In the latter case, I kept on gettng the error message below:
Error in corFactor.corStruct(object) : NA/NaN/Inf in foreign function call (arg 1) In addition: Warning message: In Initialize.corPhyl(X[[i]], ...) : No covariate specified, species will be taken as ordered in the data frame. To avoid this message, specify a covariate containing the species names with the 'form' argument.
For the complete data that focused on the four core root traits, I used the code below and it worked fine.
summary(m1 <- gls(k ~ log(rtd), correlation = corPagel(1,phy = tree, fixed=F), data = dat, method = "ML"))
For the other root traits where the missing data has been dropped, I used the code below and I was getting the eroor quoted above.
summary(m10 <- gls(k ~ log(r.lignin), correlation = corPagel(1,phy = tree, fixed=FALSE), data = dat2, method = "ML"))
dat - the dataset with complete (63) observations dat2 - NAs has been removed, leaving 38 observations
I was expecting the PGLS results to provide infomration on lambda, p-value, standard error, among others.