育种数据分析之放飞自我分享 http://blog.sciencenet.cn/u/yijiaobai 关注:生物统计,数量遗传,混合线性模型,生物信息,R,Perl,Python,GWAS,GS相关方法,文章及代码

博文

SAS、SPSS、R和GenStat分析裂区试验数据 代码、模型干货分享

已有 7559 次阅读 2015-12-30 21:34 |个人分类:农学统计|系统分类:科研笔记

SAS、SPSS、R和GenStat在裂区试验数据 分析中如何实现
结论:
1、四种软件结果再平衡数据(没有缺失值)的情况下是一致的。
2、SAS和R进行多重比较时比较麻烦。
3、SPSS根本就无法对交互作用的因子进行多重比较,而且多重比较的形式乖乖的。
4、GenStat操作最简单,结果最直观。
ps:如果想咨询数据分析的问题,请加入群: 203276907,这里有软件免费试用和数据分析咨询。
数据:data:oats.xls(见附件,或者到群里面下载)Oats.xlsx
该试验处理3个燕麦品种(Victoy,Golden rain和Marvelous)和4种氮水平(0,0.2,0.4,0.6 cwt),设置6个区组。因为在较小的小区处理肥料比较品种更方便,每个区组先区分3个主区,每个主区再分为4个副区。品种当成主区,氮水平当成副区。构成二因素裂区随机区组设计。
1数据截图
2 GenStat对应模型,有专门分析裂区试验的模块
22 多重比较的模型

方差分析结果:



多重比较结果
R语言处理裂区试验代码:
df <- read.csv("Oats.csv",header = T)
head(df)
str(df)
df$blocks <- as.factor(df$blocks)
df$wplots <- as.factor(df$wplots)
df$subplots <- as.factor(df$subplots)
str(df)
attach(df)
fit <- aov(yield~variety*nitrogen + Error(blocks/variety))
summary(fit)
结果:
> summary(fit)
Error: blocks
         Df Sum Sq Mean Sq F value Pr(>F)
Residuals  5  15875    3175              
Error: blocks:variety
         Df Sum Sq Mean Sq F value Pr(>F)
variety    2   1786   893.2   1.485  0.272
Residuals 10   6013   601.3              
Error: Within
                Df Sum Sq Mean Sq F value   Pr(>F)    
nitrogen          3  20020    6674  37.686 2.46e-12 ***
variety:nitrogen  6    322      54   0.303    0.932    
Residuals        45   7969     177                    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
SPSS裂区试验
模型设置
模型如下
4将命令修改如下:(在新建,语句里面把命令复制进去)
5 spss结果

SAS数据及其命令:
data split;
input block$ w$ s$ v$ n$ y;
cards;
1 1 1 Marvellous 0.6cwt 156
1 1 2 Marvellous 0.4cwt 118
1 1 3 Marvellous 0.2cwt 140
1 1 4 Marvellous 0cwt 105
1 2 1 Victory 0cwt 111
1 2 2 Victory 0.2cwt 130
1 2 3 Victory 0.6cwt 174
1 2 4 Victory 0.4cwt 157
1 3 1 Goldenrain 0cwt 117
1 3 2 Goldenrain 0.2cwt 114
1 3 3 Goldenrain 0.4cwt 161
1 3 4 Goldenrain 0.6cwt 141
2 1 1 Marvellous 0.4cwt 104
2 1 2 Marvellous 0cwt 70
2 1 3 Marvellous 0.2cwt 89
2 1 4 Marvellous 0.6cwt 117
2 2 1 Victory 0.6cwt 122
2 2 2 Victory 0cwt 74
2 2 3 Victory 0.2cwt 89
2 2 4 Victory 0.4cwt 81
2 3 1 Goldenrain 0.2cwt 103
2 3 2 Goldenrain 0cwt 64
2 3 3 Goldenrain 0.4cwt 132
2 3 4 Goldenrain 0.6cwt 133
3 1 1 Goldenrain 0.2cwt 108
3 1 2 Goldenrain 0.4cwt 126
3 1 3 Goldenrain 0.6cwt 149
3 1 4 Goldenrain 0cwt 70
3 2 1 Marvellous 0.6cwt 144
3 2 2 Marvellous 0.2cwt 124
3 2 3 Marvellous 0.4cwt 121
3 2 4 Marvellous 0cwt 96
3 3 1 Victory 0cwt 61
3 3 2 Victory 0.6cwt 100
3 3 3 Victory 0.2cwt 91
3 3 4 Victory 0.4cwt 97
4 1 1 Marvellous 0.4cwt 109
4 1 2 Marvellous 0.6cwt 99
4 1 3 Marvellous 0cwt 63
4 1 4 Marvellous 0.2cwt 70
4 2 1 Goldenrain 0cwt 80
4 2 2 Goldenrain 0.4cwt 94
4 2 3 Goldenrain 0.6cwt 126
4 2 4 Goldenrain 0.2cwt 82
4 3 1 Victory 0.2cwt 90
4 3 2 Victory 0.4cwt 100
4 3 3 Victory 0.6cwt 116
4 3 4 Victory 0cwt 62
5 1 1 Goldenrain 0.6cwt 96
5 1 2 Goldenrain 0cwt 60
5 1 3 Goldenrain 0.4cwt 89
5 1 4 Goldenrain 0.2cwt 102
5 2 1 Victory 0.4cwt 112
5 2 2 Victory 0.6cwt 86
5 2 3 Victory 0cwt 68
5 2 4 Victory 0.2cwt 64
5 3 1 Marvellous 0.4cwt 132
5 3 2 Marvellous 0.6cwt 124
5 3 3 Marvellous 0.2cwt 129
5 3 4 Marvellous 0cwt 89
6 1 1 Victory 0.4cwt 118
6 1 2 Victory 0cwt 53
6 1 3 Victory 0.6cwt 113
6 1 4 Victory 0.2cwt 74
6 2 1 Goldenrain 0.6cwt 104
6 2 2 Goldenrain 0.4cwt 86
6 2 3 Goldenrain 0cwt 89
6 2 4 Goldenrain 0.2cwt 82
6 3 1 Marvellous 0cwt 97
6 3 2 Marvellous 0.2cwt 99
6 3 3 Marvellous 0.4cwt 119
6 3 4 Marvellous 0.6cwt 121
;
proc print data=split;
run;
proc anova;
class block v n;
model y= block v n block*v v*n;
test H=v e=block*v;
run;
结果如下:
自由度平方和均方F 值Pr > F
模型2644017.194441692.969029.56<.0001
误差457968.75000177.08333

校正合计7151985.94444


R 方变异系数根 MSEy 均值
0.84671312.7988713.30727103.9722
自由度Anova SS均方F 值Pr > F
block515875.277783175.0555617.93<.0001
v21786.36111893.180565.040.0106
n320020.500006673.5000037.69<.0001
block*v106013.30556601.330563.400.0023
v*n6321.7500053.625000.300.9322
使用 Anova MS 作为 block*v 的误差项的假设检验
自由度Anova SS均方F 值Pr > F
v21786.361111893.1805561.490.2724

生物统计与数量遗传学公众号




https://blog.sciencenet.cn/blog-2577109-946943.html

上一篇:不完全双列杂交NCⅡ设计的数据处理方法
下一篇:双标图GGE分析在农作物品种多点试验中的应用(综述)
收藏 IP: 111.202.84.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-4-18 17:19

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部