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 !
0 个评论
采纳的回答
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)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 ANOVA 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!