请选择 进入手机版 | 继续访问电脑版
楼主: hh9550
16969 5

请问用R进行方差分析后,如何利用新复极差法进行均值多重比较? [推广有奖]

  • 0关注
  • 0粉丝

高中生

10%

还不是VIP/贵宾

-

威望
0
论坛币
46 个
通用积分
0.0014
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
260 点
帖子
23
精华
0
在线时间
18 小时
注册时间
2006-9-24
最后登录
2022-11-7

hh9550 发表于 2009-8-11 11:07:30 |显示全部楼层 |坛友微信交流群

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
用R进行方差分析后,如何利用新复极差法进行均值多重比较?                                                                                                                                                                             
                                新复极差法是邓肯(Duncan)1955年在其1951年的极差法的基础上提出的,也叫SSR法或者叫MRT法,
在R中,只知道t法是使用pairwise.t.test()进行比较,没有找到ssr法的资料,请大侠指教,需要用到什么包?或者调用什么函数?如果还无解可以去哪里问呢?
统计之都无解啊,比较常用的方法了。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:多重比较 方差分析 pairwise duncan WISE 方差分析 均值

回帖推荐

davidhaitaopan 发表于3楼  查看完整内容

给你个上课的例子,后面部分用的是Minitab,但图粘不上来! Today’s contents: Multiple Comparisons . Page:87-105 (3-5.4 Contrasts, 3-5.5 Orthogonal Contrasts, and 3-5.6 Scheffe’s Methods for Comparing All Contrasts, are left to you to do exercises) We still use the example 3-1. Example 3.1 The Plasma Etching Experiment Data is as followed: RF Power(W) Observed Etch Rate(A/min) 1 2 3 4 5 ...

本帖被以下文库推荐

zwdbordeaux 发表于 2009-8-13 02:58:50 |显示全部楼层 |坛友微信交流群
呵呵,在cos上已经给你了答案。
世界真小!

使用道具

给你个上课的例子,后面部分用的是Minitab,但图粘不上来!
Today’s contents:
  Multiple Comparisons . Page:87-105
(3-5.4 Contrasts, 3-5.5 Orthogonal Contrasts, and 3-5.6 Scheffe’s Methods for Comparing All Contrasts, are left to you to do exercises)
We still use the example 3-1.
Example 3.1 The Plasma Etching Experiment
Data is as followed:
RF Power(W)        Observed Etch Rate(A/min)
        1        2        3        4        5
160        575        542        530        539        570
180        565        593        590        579        610
200        600        651        610        637        629
220        725        700        715        685        710


3-5.7 Comparing Pairs of Treatment Means
First, I perform the Tukey’s Test ,also called Tukey’s Honestly Significant Difference Test( abbreviated as HSD).
We already knew that the HSD test focuses on the experiment wise error rate, a, and assumes that the number of replicates at each level are equal. To use the function, an aov object is required as the first argument.

> #eg 3-1
> X=c(575,542,530,539,570,
+     565,593,590,579,610,
+     600,651,610,637,629,
+     725,700,715,685,710)
> A=factor(rep(1:4,each=5))
> #construct a data.frame
> shuju=data.frame(X,A)
> aov.shuju=aov(X~A,data=shuju)
> shuju.tukey=TukeyHSD(aov.shuju,ordered=T)
> shuju.tukey
  Tukey multiple comparisons of means
    95% family-wise confidence level
    factor levels have been ordered

Fit: aov(formula = X ~ A, data = shuju)

$A
     diff        lwr       upr     p adj
2-1  36.2   3.145624   69.25438   0.0294279
3-1  74.2   41.145624  107.25438  0.0000455
4-1  155.8  122.745624  188.85438  0.0000000
3-2  38.0   4.945624   71.05438    0.0215995
4-2  119.6   86.545624  152.65438  0.0000001
4-3  81.6   48.545624   114.65438  0.0000146


We can see immediately that all pairs of means are significantly different. Therefore, each power setting results in a mean etch rate that differs from the mean etch rate at any other power setting.
We also can plot the confidence intervals, which is more explicitly.


> plot(shuju.tukey)



Conclusions are the same as before.

Now we perform the LSD test to our above example. The LSD test essentially involves performing a series of pair wise t test. It is important to note that with LSD, we have to specify the individual error rate, not the experimentwise or family error rate.
Assume here that we wish to find the LSD between level 1 and 3.

> n1=sum(aov.shuju$model$A=='1')
> n1
[1] 5
> n3=sum(aov.shuju$model$A=='3')
> n3
[1] 5
> s=sqrt(sum((aov.shuju$residuals)^2)/aov.shuju$df.residual)
> s
[1] 18.26746
> s^2
[1] 333.7
> tcrit=qt(0.025,aov.shuju$df.residual,lower.tail=F)
> tcrit
[1] 2.119905
> LSD=tcrit*s*sqrt(1/n1+1/n3)
> LSD
[1] 24.49202
> #and
> y1.bar=sum(shuju$X[A=='1'])/5
> y1.bar
[1] 551.2
> y3.bar=sum(shuju$X[A=='3'])/5
> y3.bar
[1] 625.4
> y1.bar-y3.bar
[1] -74.2
>

Because   , so this implies that level 1 and level 3 ‘s means are significantly different. You can follow the exactly the same routine to compare the rest pair of means.


The Dunnett test can compare treatment means with a control, which is onerous to perform in R. Now I use the Minitab software to do this job.
Step1: Input the data.

Step2: Select the “比较”button ,and we can see that there are three commonly used multiple comparison test (include Fisher’s LSD, and Tukey’s HSD).


Step3: just press ok is ok. Below are the printed results.

—————   2009-4-29 16:04:49   ————————————————————

欢迎使用 Minitab,请按 F1 获得有关帮助。

单因子方差分析: X 与 A

来源  自由度     SS     MS      F      P
A          3  66871  22290  66.80  0.000
误差      16   5339    334
合计      19  72210

S = 18.27   R-Sq = 92.61%   R-Sq(调整) = 91.22%


                         平均值(基于合并标准差)的单组 95% 置信区间
水平  N  平均值  标准差  ---+---------+---------+---------+------
1     5  551.20   20.02  (--*---)
2     5  587.40   16.74         (--*---)
3     5  625.40   20.53                 (--*---)
4     5  707.00   15.25                                 (--*---)
                         ---+---------+---------+---------+------
                          550       600       650       700

合并标准差 = 18.27

* 错误 * Dunnett 的控制水平不是因子水平之一。


Tukey 95% 同时置信区间
A 水平间的所有配对比较

单组置信水平 = 98.87%


A = 1 减自:

A    下限    中心    上限  -----+---------+---------+---------+----
2    3.11   36.20   69.29                 (---*--)
3   41.11   74.20  107.29                     (--*---)
4  122.71  155.80  188.89                             (---*--)
                           -----+---------+---------+---------+----
                             -100         0       100       200


A = 2 减自:

A   下限    中心    上限  -----+---------+---------+---------+----
3   4.91   38.00   71.09                 (---*--)
4  86.51  119.60  152.69                          (--*--)
                          -----+---------+---------+---------+----
                            -100         0       100       200


A = 3 减自:

A   下限   中心    上限  -----+---------+---------+---------+----
4  48.51  81.60  114.69                      (--*--)
                         -----+---------+---------+---------+----
                           -100         0       100       200


Fisher 95% 两水平差值置信区间
A 水平间的所有配对比较

同时置信水平 = 81.11%


A = 1 减自:

A    下限    中心    上限  ----+---------+---------+---------+-----
2   11.71   36.20   60.69                 (--*-)
3   49.71   74.20   98.69                     (-*--)
4  131.31  155.80  180.29                             (--*-)
                           ----+---------+---------+---------+-----
                            -100         0       100       200


A = 2 减自:

A   下限    中心    上限  ----+---------+---------+---------+-----
3  13.51   38.00   62.49                 (--*-)
4  95.11  119.60  144.09                          (-*-)
                          ----+---------+---------+---------+-----
                           -100         0       100       200


A = 3 减自:

A   下限   中心    上限  ----+---------+---------+---------+-----
4  57.11  81.60  106.09                      (-*--)
                         ----+---------+---------+---------+-----
                          -100         0       100       200


Determining Sample Size
  Suppose that in the plasma etching experiment example, the experimenter wished to reject the null hypothesis with probability at least 0.90 if any two treatment means differed by as much as 75 A/min, and alpha=0.01. Then assuming that   =25,
  Now we first try the replicates is 4 ,then we obtain the below results:


Press ok, then

功效和样本数量

单因子方差分析

Alpha = 0.05  假定标准差 = 25  水平数 = 4


           样本            最大
SS 平均值  数量      功效  差值
   2812.5     4  0.867819    75

样本数量是指每个水平的。

So we can see we can’t reach the 0.90 power level. So we try replicate is 5, we get below:


功效和样本数量

单因子方差分析

Alpha = 0.05  假定标准差 = 25  水平数 = 4


           样本            最大
SS 平均值  数量      功效  差值
   2812.5     5  0.953578    75

样本数量是指每个水平的。


Now the power is 0.953578, exceeding 0.90, so we think each replicate is 5 is ok for this example.
We also can plot the OC curve, like below:

使用道具

hh9550 发表于 2009-8-15 09:05:47 |显示全部楼层 |坛友微信交流群
^_^,多谢楼上的,今天在cos上也看到了。

使用道具

hh9550 发表于 2009-8-15 09:06:52 |显示全部楼层 |坛友微信交流群
3# davidhaitaopan


^_^,多谢楼上的,世界真小呵呵。

使用道具

hh9550 发表于 2019-8-19 19:08:16 |显示全部楼层 |坛友微信交流群
正好十年过去了,偶然翻到这个帖子没有准确的答案,给自己做一个准确的答复吧:agricolae包,使用duncan.test(y,trt,alpha,console=TRUE)说明:y为(aov or lm)分析式,trt为比较对象,阿尔法为显著水平,console为是否在控制台上显示结果。其他更具体参考软件的帮助。顺便提一下,特意翻了十年前下载的agricolae包,发现没有duncan.test。

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-3-29 20:26