||
> library(agridat)
> data("oats")
> head(oats)
Blocks Nitrogen Subplots Variety Wplots yield
1 1 0.6_cwt 1 Marvellous 1 156
2 1 0.4_cwt 2 Marvellous 1 118
3 1 0.2_cwt 3 Marvellous 1 140
4 1 0_cwt 4 Marvellous 1 105
5 1 0_cwt 1 Victory 2 111
6 1 0.2_cwt 2 Victory 2 130
> mod = aov(yield ~ Blocks + Variety*Nitrogen,data=oats)
> summary(mod)
Df Sum Sq Mean Sq F value Pr(>F)
Blocks 5 15875 3175 12.489 4.09e-08 ***
Variety 2 1786 893 3.513 0.0366 *
Nitrogen 3 20021 6674 26.251 1.13e-10 ***
Variety:Nitrogen 6 322 54 0.211 0.9719
Residuals 55 13982 254
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
想要结果类型如下:
将方差分析表, 放到Excel里面, 首先看组合, 组合的自由度 = P1 + P2 + P1XP2
即: 92 = 2 + 30 + 60
同理, 平方和SS也是一样的
MS = SS/DF
F = MS/MS(误差)
P值查表即可.
Excel结果:
我将模板放到附件里面, 里面有具体的公式.
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-4-20 20:41
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社