anova1 within groups degree of freedom ?

5 次查看(过去 30 天)
Hi,
I am doing an ANOVA with anova1 : anova1(D,X) X is such that there are only two groups, but the number of observations is not the same for these two groups.
How do I know the "within groups" degree of freedom ? I don't know where to read it from the output ... :-(
thank you !

采纳的回答

Wayne King
Wayne King 2012-5-24
strength = [82 86 79 83 84 85 86 87 74 82 78 75 76 77 79 79 77 78 82 79];
alloy = {'st','st','st','st','st','st','st','st','al1','al1','al1','al1','al1','al1', 'al2','al2','al2','al2','al2','al2'};
p = anova1(strength,alloy)
If N is the total number of observations and k is the number of groups, then N-k is the within groups DOF, k-1 is the between, and N-1 is the total. N-1 = (N-k) + (k-1). On the anova1 table these are:
k -1 (Groups)
N-k (Error)
N-1 (Total)
withingroup = length(strength) - length(unique(alloy))
betweengroup = length(unique(alloy))-1
totaldof = length(strength)-1
In the above, you can see that the F statistic value should be:
Fval = (184.8/2)/(102/17)
  1 个评论
laurie
laurie 2012-5-24
ok thanks ! so the within group df is the one that is in the "Error" row, not the Total :-)

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 ANOVA 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by