TukeyC-package(TukeyC)
TukeyC-package()所属R语言包:TukeyC
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This package performs what is known as the Tukey HSD test in the conventional way. It also uses an algorithm which divides the set of all means in groups and assigns letters to the different groups, allowing for overlapping. This is done for simple experimental designs and schemes. The most usual designs are: Completely Randomized Design (CRD), Randomized Complete Block Design (RCBD) and Latin Squares Design (LSD). The most usual schemes are: Factorial Experiment (FE), Split-Plot Experiment (SPE) and Split-Split-Plot Experiment (SPE).
此包执行什么是被称为杜克HSD测试在常规的方式。它也使用的算法将组和受让人字母不同群体的各种手段,让重叠的。这样做是为了简单的实验设计和计划。最常用的设计:完全随机设计(CRD),完全随机区组的设计(RCBD)和拉丁方设计(LSD)。最常用的方案是:析因试验(FE),裂区试验(SPE)和分离式裂区试验(SPE)。
The package can be used for both balanced or unbalanced (when possible), experiments.
该软件包可以用于平衡或不平衡(如果可能),实验。
R has some functions (TukeyHSD provided by stats, glht provided by multcomp, HSD.test provided by agricolae and cld provided by multcomp) which also performs the Tukey test. The TukeyHSD returns intervals based on the range of the sample means rather than the individual differences. Those intervals are based on Studentized range statistics and are, in essence, confidence intervals. This approach has two advantages: the p-value is showed allowing the user to flexibilize the inferencial decision and also make it possible to plot the result of the test. However, it has one disadvantage, since the final result is more difficult to understand and summarize. Others (glht, cld) are also useful but difficult to manage. Additionally, most of users of other statistical softwares are very used with letters grouping the means of the factor tested, making unattractive or difficult to adapt to the current aproach of R.
R有一些功能(TukeyHSD提供的stats,glht提供的multcomp,HSD.test的agricolae提供和cld提供由的multcomp)还执行Tukey检验。 TukeyHSD返回的时间间隔范围的样本的基础上,而不是指个体的差异。这些时间间隔是基于学生化的范围统计,在本质上,置信区间。这种方法有两个优点:允许用户弹性化的inferencial的决定,并且也使得能够绘制的结果的测试结果表明的p-值。然而,它有一个缺点,因为最后的结果是比较困难的理解和总结。其他(glht,cld)是有用的,但难以管理。此外,大多数的其他统计软件的用户非常习惯用字母分组的方式进行测试的因素,吸引力或难以适应当前的形式给出的R.
So, the main aim of this package is make available in R environment the conventional aproach of Tukey test with a set of flexible funtions and
所以,这个包的主要目的是提供在R环境中,传统的形式给出的Tukey检验一套灵活的funtions,
(作者)----------Author(s)----------
Jose Claudio Faria (<a href="mailto:joseclaudio.faria@gmail.com">joseclaudio.faria@gmail.com</a>)<br>
Enio Jelihovschi (<a href="mailto:eniojelihovs@gmail.com">eniojelihovs@gmail.com</a>)<br>
Ivan Bezerra Allaman (<a href="mailto:ivanalaman@gmail.com">ivanalaman@gmail.com</a>)
参考文献----------References----------
e Melhoramento de Plantas. Editora UFLA.
a biometrical approach. Third Edition.
实例----------Examples----------
##[#]
## Examples: Completely Randomized Design (CRD)[#示例:完全随机设计(CRD)]
## More details: demo(package='TukeyC')[更多细节:演示(包=TukeyC“的)]
##[#]
## The parameters can be: vectors, design matrix and the response variable,[#参数可以是:向量,设计矩阵和响应变量,]
## data.frame or aov[#数据框或AOV]
data(CRD2)
## From: design matrix (dm) and response variable (y) - balanced[#从设计矩阵(DM)和响应变量(Y) - 平衡]
tk1 <- with(CRD2,
TukeyC(x=dm,
y=y,
model='y ~ x',
which='x'))
summary(tk1)
plot(tk1, id.las=2, rl=FALSE)
## From: design matrix (dm) and response variable (y) - unbalanced[#:设计矩阵(DM)和因变量(Y) - 不平衡]
tk1u <- with(CRD2,
TukeyC(x=dm[-1,],
y=y[-1],
model='y ~ x',
which='x'))
summary(tk1u)
## From: data.frame (dfm) - balanced[#从数据框(DFM) - 平衡]
tk2 <- with(CRD2,
TukeyC(x=dfm,
model='y ~ x',
which='x'))
summary(tk2)
## From: data.frame (dfm) - balanced[#从数据框(DFM) - 平衡]
tk2u <- with(CRD2,
TukeyC(x=dfm[-1,],
model='y ~ x',
which='x'))
summary(tk2u)
## From: aov - balanced[#:AOV - 平衡]
av <- with(CRD2,
aov(y ~ x,
data=dfm))
summary(av)
tk3 <- with(CRD2,
TukeyC(x=av,
which='x'))
summary(tk3)
## From: aov - unbalanced[#:AOV - 不平衡]
avu <- with(CRD2,
aov(y ~ x,
data=dfm[-1,]))
summary(avu)
tk3u <- with(CRD2,
TukeyC(x=avu,
which='x'))
summary(tk3u)
##[#]
## Example: Randomized Complete Block Design (RCBD)[#例如:随机区组设计(RCBD)]
## More details: demo(package='TukeyC')[更多细节:演示(包=TukeyC“的)]
##[#]
## The parameters can be: design matrix and the response variable,[#参数可以是:设计矩阵和响应变量,]
## data.frame or aov[#数据框或AOV]
data(RCBD)
## Design matrix (dm) and response variable (y)[设计矩阵(DM)和响应变量(Y)]
tk1 <- with(RCBD,
TukeyC(x=dm,
y=y,
model='y ~ blk + tra',
which='tra'))
summary(tk1)
plot(tk1)
## From: data.frame (dfm), which='tra'[#从数据框(DFM),=茶]
tk2 <- with(RCBD,
TukeyC(x=dfm,
model='y ~ blk + tra',
which='tra'))
summary(tk2)
##[#]
## Example: Latin Squares Design (LSD)[#例如:拉丁方设计(LSD)]
## More details: demo(package='TukeyC')[更多细节:演示(包=TukeyC“的)]
##[#]
## The parameters can be: design matrix and the response variable,[#参数可以是:设计矩阵和响应变量,]
## data.frame or aov[#数据框或AOV]
data(LSD)
## From: design matrix (dm) and response variable (y)[#:设计矩阵(DM)和响应变量(Y)]
tk1 <- with(LSD,
TukeyC(x=dm,
y=y,
model='y ~ rows + cols + tra',
which='tra'))
summary(tk1)
plot(tk1)
## From: data.frame[#从数据框]
tk2 <- with(LSD,
TukeyC(x=dfm,
model='y ~ rows + cols + tra',
which='tra'))
summary(tk2)
## From: aov[#:AOV]
av <- with(LSD,
aov(y ~ rows + cols + tra,
data=dfm))
summary(av)
tk3 <- TukeyC(av,
which='tra')
summary(tk3)
##[]
## Example: Factorial Experiment (FE)[#示例:因子实验(FE)]
## More details: demo(package='TukeyC')[更多细节:演示(包=TukeyC“的)]
##[#]
## The parameters can be: design matrix and the response variable,[#参数可以是:设计矩阵和响应变量,]
## data.frame or aov[#数据框或AOV]
data(FE)
## From: design matrix (dm) and response variable (y)[#:设计矩阵(DM)和响应变量(Y)]
## Main factor: N[#主要因素:N]
tk1 <- with(FE,
TukeyC(x=dm,
y=y,
model='y ~ blk + N*P*K',
which='N'))
summary(tk1)
plot(tk1)
## Nested: p1/N[#嵌套:P1 / N]
ntk1 <- with(FE,
TukeyC.nest(x=dm,
y=y,
model='y ~ blk + N*P*K',
which='N',
fl2=1))
summary(ntk1)
## Nested: k1/P[#嵌套:K1 / P]
ntk2 <- with(FE,
TukeyC.nest(x=dm,
y=y,
model='y ~ blk + N*P*K',
which='P:K',
fl2=1))
summary(ntk2)
## Nested: k2/p2/N[#嵌套:k2/p2/N]
ntk3 <- with(FE,
TukeyC.nest(x=dm,
y=y,
model='y ~ blk + N*P*K',
which='N:K',
fl2=2,
fl3=2))
summary(ntk3)
## Nested: k1/n1/P[#嵌套:k1/n1/P]
ntk4 <- with(FE,
TukeyC.nest(x=dm,
y=y,
model='y ~ blk + P*N*K',
which='P:N:K',
fl2=1,
fl3=1))
summary(ntk4)
## Nested: p1/n1/K[#嵌套:p1/n1/K]
ntk5 <- with(FE,
TukeyC.nest(x=dm,
y=y,
model='y ~ blk + K*N*P',
which='K:N',
fl2=1,
fl3=1))
summary(ntk5)
##[#]
## Example: Split-plot Experiment (SPE)[#例如:裂区试验(SPE)]
## More details: demo(package='TukeyC')[更多细节:演示(包=TukeyC“的)]
##[#]
data(SPE)
## The parameters can be: design matrix and the response variable,[#参数可以是:设计矩阵和响应变量,]
## data.frame or aov[#数据框或AOV]
## From: design matrix (dm) and response variable (y)[#:设计矩阵(DM)和响应变量(Y)]
## Main factor: P [#主因子:P]
tk1 <- with(SPE,
TukeyC(x=dm,
y=y,
model='y ~ blk + SP*P + Error(blk/P)',
which='P',
error='blk'))
summary(tk1)
## Main factor: SP[#主要因素:SP]
tk2 <- with(SPE,
TukeyC(x=dm,
y=y,
model='y ~ blk + SP*P + Error(blk/P)',
which='SP',
error='Within'))
summary(tk2)
plot(tk2)
## Nested: sp/p=1[#嵌套:SP / P = 1]
tkn1 <- with(SPE,
TukeyC.nest(x=dm,
y=y,
model='y ~ blk + SP*P + Error(blk/P)',
which='SP',
error='Within',
fl2=1 ))
summary(tkn1)
##[#]
## Example: Split-split-plot Experiment (SSPE)[#例如:分割裂区试验(SSPE)]
## More details: demo(package='TukeyC')[更多细节:演示(包=TukeyC“的)]
##[#]
data(SSPE)
## From: design matrix (dm) and response variable (y)[#:设计矩阵(DM)和响应变量(Y)]
## Main factor: P[#主因子:P]
tk1 <- with(SSPE,
TukeyC(dm,
y,
model='y ~ blk + SSP*SP*P + Error(blk/P/SP)',
which='P',
error='blk'))
summary(tk1)
# Main factor: SP[主要因素:SP]
tk2 <- with(SSPE,
TukeyC(dm,
y,
model='y ~ blk + SSP*SP*P + Error(blk/P/SP)',
which='SP',
error='blk:SP'))
summary(tk2)
# Main factor: SSP[主要因素:SSP]
tk3 <- with(SSPE,
TukeyC(dm,
y,
model='y ~ blk + SSP*SP*P + Error(blk/P/SP)',
which='SSP',
error='Within'))
summary(tk3)
plot(tk3)
## Nested: p1/SP[#嵌套:p1/SP]
tkn1 <- with(SSPE,
TukeyC.nest(dm,
y,
model='y ~ blk + SSP*SP*P + Error(blk/P/SP)',
which='SP',
error='blk:SP',
fl2=1))
summary(tkn1)
## From: aovlist[#来自:aovlist的]
av <- with(SSPE,
aov(y ~ blk + SSP*SP*P + Error(blk/P/SP),
data=dfm))
summary(av)
## Nested:sp/sp/SSP (at various levels of P and SP) [#嵌套:SP / SP / SSP(各级的P,SP)]
tkn6 <- TukeyC.nest(av,
which='SSP:SP',
error='Within',
fl2=1,
fl3=1)
summary(tkn6)
plot(tkn6)
tkn7 <- TukeyC.nest(av,
which='SSP:SP:P',
error='Within',
fl2=2,
fl3=1)
summary(tkn7)
plot(tkn7)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|