SAS、SPSS、R和GenStat在裂区试验数据 分析中如何实现(数据、代码、模型截图) 干货分享

SAS、SPSS、R和GenStat在裂区试验数据 分析中如何实现

结论:

1、四种软件结果再平衡数据(没有缺失值)的情况下是一致的。

2、SAS和R进行多重比较时比较麻烦。

3、SPSS根本就无法对交互作用的因子进行多重比较,而且多重比较的形式乖乖的。

4、GenStat操作最简单,结果最直观。

ps:如果想咨询数据分析的问题,请加入群: 203276907,这里有软件免费试用和数据分析咨询。

数据:data:oats.xls(见附件,或者到群里面下载)

该试验处理3个燕麦品种(Victoy,Golden rain和Marvelous)和4种氮水平(0,0.2,0.4,0.6 cwt),设置6个区组。因为在较小的小区处理肥料比较品种更方便,每个区组先区分3个主区,每个主区再分为4个副区。品种当成主区,氮水平当成副区。构成二因素裂区随机区组设计。

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

 

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;

 

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值