anova1 within groups degree of freedom ?

조회 수: 5 (최근 30일)
laurie
laurie 2012년 5월 24일
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