0

I am trying to run an anova by margin with my dataset, but instead of getting the varicance for each term I get only model with degrees of freedom 24 as the number of my response variable and variance changed to percentage is 100 and no residuals. like this:

    term Variance Pr(>F) var_exp
1    Model 22278.55     NA     100
2    Residual     0.00     NA       0

I give here a reproducible example where you get the anova by margin:

    data(varespec)
data(varechem)
vare.cca <- cca(varespec ~ Al + P + K, varechem)
## overall test
anova(vare.cca, by="margin")

How could I get the right output? Thanks a lot!

i.b
  • 167
  • 11
  • Your "reproducible example" does not reproduce your problem, but gives the expected result. NB, your example was overfitted: residual variance is 0.0 with 0 residual degrees of freedom and hence you cannot have an ANOVA-like test. You need more data or fewer predictor variables. (The first output of your post is not from **vegan**, and for that you should consult the author of that code.) – Jari Oksanen Apr 27 '23 at 11:55
  • thanks a lot! actually it is like you say because I can only fit 23 variables on 35.. if i add all the variables the anova gives the error you saw.. should I create two models and two plots with 2 sets of variables? – i.b Apr 27 '23 at 13:07

0 Answers0