degrees of freedom of factors in anovan

3 views (last 30 days)
Kemal
Kemal on 31 Jul 2014
Commented: Scott MacKenzie on 14 May 2021
Hello,
I am trying to run two-way ANOVA for an unbalanced design. My factors are species and functional types. There are six species and two functional types. All species except one have the same sample size. I am using anovan function to do this but I am getting zero degrees of freedom (df) for functional types and four df for species. I can't figure out why this happens. I would greatly appreciate any help. Thanks!
My data are in A=[2.1 2.3 2.2 2.1 2.1 2.4 2.5 2 2.2 2.3 1.2 1.3 1.3 1.3 1.1 1 0.9 0.7 1 1.1 1 1.1 1.1 1 1 0.4 0.6 0.5 0.7 0.7 0.6 0.7 0.6 0.7 0.7 0.7 0.8 0.7];
and the group vector I am using is defined as group = {[1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6];... {'d' 'd' 'd' 'd' 'd' 'd' 'd' 'd' 'd' 'd' ... 'c' 'c' 'c' 'c' 'c' 'c' 'c' 'c' 'c' 'c' ... 'c' 'c' 'c' 'c' 'c' 'c' 'c' 'c' 'c' 'c' ... 'c' 'c' 'c' 'c' 'c' 'c' 'c' 'c'}}; where the first row show the six species and the second row the functional types, coniferous and deciduous.
  3 Comments
Tom Hagley
Tom Hagley on 26 Apr 2020
Also agreed here, I'm getting the same problem. Hopefully someone can shed some light?
Scott MacKenzie
Scott MacKenzie on 14 May 2021
Tom or Allison: Perhaps post your data and code, and in a new question. I've done several analyses using anovan, and can probably help sort this out.

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!