lamho86/phylolm

Phyloglm univariate case: testing for phylogenetic signal

Closed this issue · 4 comments

Hello,

I am interested in testing the strength of phylogenetic signal in my residuals (alpha term in phyloglm summary output) in my model for a numeric, binary response, in the absence of independent variables (sensu Ives and Garland [2010]). Is this possible in R? I attempted to run this as a null model (which may not even be what I want!), but that model returned the following error message:

model:
model <- phyloglm(response ~ -1, data = data, boot = 1000, phy = tree, method = 'logistic_MPLE', btol = 50)

error message:
Error in x[, ii] : subscript out of bounds

Any advice on how to code this model as a univariate model in R would be extremely helpful.

If any of this is unclear, I'd be happy to provide more information. Thanks so much for your time, I very much appreciate this package, and your work on this topic.

Why did you use -1 in the formula? Could you use 1 instead, like this:

model <- phyloglm(response ~ 1, data = data, boot = 1000, phy = tree, method = 'logistic_MPLE', btol = 50)

Admittedly, I didn't know what to put in the formula, but when I use '1' instead, I get an error message:

Error in rbinTrait(n = boot, phy = phy, beta = results$coefficients, alpha = results$alpha, :
The design matrix is not needed when the coefficient is a scalar.

Do you need bootstrap? The error seems to be in the bootstrap procedue. If you set boot = 0, the error may go away.
However, I don't understand why this can happen. Did you use the most up-to-date version (can be installed from this github)?

That worked! After I removed the bootstrap argument (or set boot = 0), the error disappeared, the model ran, and I was able to view the parameter estimates of the model with the summary function.

original model (produced error):
model <- phyloglm(response ~ 1, data = data, boot = 1000, phy = tree, method = 'logistic_MPLE', btol = 50)

revised model (no error):
model1 <- phyloglm(response ~ 1, data = data, phy = tree, method = 'logistic_MPLE', btol = 50)

I ran this with 'phylolm' v.2.6.2. Thank you both for your help.