-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extracting coefficients #640
Comments
The coefficients were indeed dropped from library(vegan)
data(dune, dune.env)
ado <- adonis(dune ~ Moisture, dune.env) # deprecated
coef(ado)[,1:3]
# Achimill Agrostol Airaprae
# (Intercept) 0.73214286 2.6607143 0.23214286
# Moisture.L -1.29372504 2.8909165 0.17569106
# Moisture.Q -0.03571429 -1.1785714 -0.03571429
# Moisture.C 0.68679231 0.5909608 0.43124168
## linear model for these three species
lm(as.matrix(dune[,1:3]) ~ Moisture, dune.env)
# Call:
# lm(formula = as.matrix(dune[, 1:3]) ~ Moisture, data = dune.env)
# Coefficients:
# Achimill Agrostol Airaprae
# (Intercept) 0.73214 2.66071 0.23214
# Moisture.L -1.29373 2.89092 0.17569
# Moisture.Q -0.03571 -1.17857 -0.03571
# Moisture.C 0.68679 0.59096 0.43124
## you can also get these manually from rda for centred data: (Intercept) is zero
mod <- rda(dune ~ Moisture, dune.env)
qr.coef(qr(mod), as.matrix(dune[,1:3]))
# Achimill Agrostol Airaprae
# Moisture.L -1.29372504 2.8909165 0.17569106
# Moisture.Q -0.03571429 -1.1785714 -0.03571429
# Moisture.C 0.68679231 0.5909608 0.43124168 This highlights the problem with species coefficients: they were based on Euclidean distances and are correct when Euclidean distances were used in As to site scores: they were wrongly calculated in |
Hi, sorry for my late reply. Thank you for the explanation, it makes much more sense now! |
Hi,
I saw that it was possible to extract the coefficients of the linear model for each species of the community with the now deprecated function adonis. I couldn't find a way to do so with adonis2. Has the data been removed from the output? If so, what are alternatives methods to estimate which taxa are contributing the most to the observed differences?
Thanks a lot :)
The text was updated successfully, but these errors were encountered: