Is my interpretation of pglmm (package phyr) output correct? Does model specification make sense?

18 views Asked by At

I am trying to address a question related to possible effects of ‘common descent’ (i.e. phylogeny) on an observed relationship between a response and a (species-level) predictor.

I’ve been using the phyr package to walk my way through the pglmm options for testing phylogenetics as part of the random effects structure, and and I am running into some issues with parts of the code.

Specifically, following some other examples, I have taken residuals from our top model and am attempting to test for phylogenetic covariance in those residuals, using the following:

M1 <-pglmm(residuals ~ 1 + (1|sp),data= dat, family="gaussian",sp=tree1) ##(sp = species designation)

Based on the summary for this model, it appears that species accounts for approximately 6% of the variance in the residuals, but I am not entirely convinced that the phylogenetic correction is in there.

Linear mixed model fit by restricted maximum likelihood

Call:residuals ~ 1

logLik    AIC    BIC 
-26467  52941  52958 

Random effects:
         Variance Std.Dev
1|sp        2.012   1.418
residual   29.821   5.461

Fixed effects:
              Value Std.Error Zscore Pvalue
(Intercept) 0.35232   0.50717 0.6947 0.4873

According to the phyr documentation, the code should look like that below, with the double underscore after sp specifying the phylogenetic covariance:

M2 <- pglmm(residuals ~ 1 + (1|sp__), data = dat, family = "gaussian", cov_ranef = list(sp = tree1))

However, this model will not run for me. The error seems to be related to the fact that object 'Vphy' cannot be found.

Can anybody familiar with 'phyr' explain to me if the first model is in fact accounting for phylogenetic covariance, and if not, is there a coding change that I can make to get the output I need?

With many thanks.

0

There are 0 answers