Anovan gives contradicting results
조회 수: 1 (최근 30일)
이전 댓글 표시
I was playing around with the toy example on this page: http://www.mathworks.co.uk/help/stats/anovan.html And I tried the following:
y = [52.7 57.5 45.9 44.5 53.0 57.0 45.9 44.0]';
g1 = [1 2 1 2 1 2 1 2];
g2 = {'hi';'hi';'lo';'lo';'hi';'hi';'lo';'lo'};
g3 = {'may';'may';'may';'may';'june';'june';'june';'june'};
p_0 = anovan(y, {g1})
p_1 = anovan(y, {g1 g2})
p_2 = anovan(y, {g1 g2 g3})
which gives:
p_0 =
0.7577
p_1 =
0.3596
0.0007
p_3 =
0.4174
0.0028
0.9140
But I would expect p_0[0], p_1[0], p_2[0] to be the same. But they are not? Can anybody explain me why?
댓글 수: 0
답변 (1개)
Tom Lane
2013년 3월 20일
This is a balanced design, so the sum of squares explained by g1 is indeed the same in each case. But its F statistic and p-value are not. That's because the F statistic is the ratio of the terms mean square to the error mean square. As you add more terms, the error mean square changes.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!