If the variance explained is OK, then this is given by anova(model, by = "margin"). This tests marginal effects, hence this is a test of the amount of additional variance explained by adding that variable to a model that already contains all the other variables.
library("vegan")
data(varespec, varechem)
vare.cap <- capscale(varespec ~ N + P + K + Condition(Al), data = varechem,
dist="bray")
anova(vare.cap, by = "margin")
This gives us:
> anova(vare.cap, by = "margin")
Permutation test for capscale under reduced model
Marginal effects of terms
Permutation: free
Number of permutations: 999
Model: capscale(formula = varespec ~ N + P + K + Condition(Al), data = varechem, distance = "bray")
Df Variance F Pr(>F)
N 1 0.27719 1.8616 0.093 .
P 1 0.20764 1.3945 0.191
K 1 0.22249 1.4943 0.151
Residual 19 2.82904
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
If you want the marginal variance explained, then you need to divide those values by with(vare.cap, tot.chi - CA$imaginary.chi) if you have imaginary eigenvalues or vby with(vare.cap, tot.chi) if you don't. For example
> set.seed(1)
> marg <- anova(vare.cap, by = "margin")
> marg
Permutation test for capscale under reduced model
Marginal effects of terms
Permutation: free
Number of permutations: 999
Model: capscale(formula = varespec ~ N + P + K + Condition(Al), data = varechem, distance = "bray")
Df Variance F Pr(>F)
N 1 0.27719 1.8616 0.065 .
P 1 0.20764 1.3945 0.201
K 1 0.22249 1.4943 0.150
Residual 19 2.82904
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
> marg$Variance / with(vare.cap, tot.chi - CA$imaginary.chi)
[1] 0.05770665 0.04322702 0.04631963 0.58896598
That last line contains the proportions of variance explained out of the total variance. If you want to ignore (or don't have any) imaginary eigenvalues, then you can just do
> marg$Variance / with(vare.cap, tot.chi)
[1] 0.06099498 0.04569025 0.04895909 0.62252739
TotalorReal Totalvalue in the output fromvare.cap. – Gavin Simpson Jun 17 '15 at 16:27