##
## Examples: Completely Randomized Design (CRD)
## More details: demo(package='TukeyC')
##
## The parameters can be: vectors, design matrix and the response variable,
## data.frame or aov
data(CRD2)
## From: design matrix (dm) and response variable (y)
tk1 <- with(CRD2,
TukeyC(x=dm,
y=y,
model='y ~ x',
which='x',
id.trim=5))
summary(tk1)
## From: data.frame (dfm)
tk2 <- with(CRD2,
TukeyC(x=dfm,
model='y ~ x',
which='x',
id.trim=5))
summary(tk2)
## From: aov
av <- with(CRD2,
aov(y ~ x,
data=dfm))
summary(av)
tk3 <- with(CRD2,
TukeyC(x=av,
which='x',
id.trim=5))
summary(tk3)
##
## Example: Randomized Complete Block Design (RCBD)
## More details: demo(package='TukeyC')
##
## The parameters can be: design matrix and the response variable,
## data.frame or aov
data(RCBD)
## Design matrix (dm) and response variable (y)
tk1 <- with(RCBD,
TukeyC(x=dm,
y=y,
model='y ~ blk + tra',
which='tra'))
summary(tk1)
## From: data.frame (dfm), which='tra'
tk2 <- with(RCBD,
TukeyC(x=dfm,
model='y ~ blk + tra',
which='tra'))
summary(tk2)
##
## Example: Latin Squares Design (LSD)
## More details: demo(package='TukeyC')
##
## The parameters can be: design matrix and the response variable,
## data.frame or aov
data(LSD)
## From: design matrix (dm) and response variable (y)
tk1 <- with(LSD,
TukeyC(x=dm,
y=y,
model='y ~ rows + cols + tra',
which='tra'))
summary(tk1)
## From: data.frame
tk2 <- with(LSD,
TukeyC(x=dfm,
model='y ~ rows + cols + tra',
which='tra'))
summary(tk2)
## From: aov
av <- with(LSD,
aov(y ~ rows + cols + tra,
data=dfm))
summary(av)
tk3 <- TukeyC(av,
which='tra')
summary(tk3)
##
## Example: Factorial Experiment (FE)
## More details: demo(package='TukeyC')
##
## The parameters can be: design matrix and the response variable,
## data.frame or aov
data(FE)
## From: design matrix (dm) and response variable (y)
## Main factor: N
tk1 <- with(FE,
TukeyC(x=dm,
y=y,
model='y ~ blk + N*P*K',
which='N'))
summary(tk1)
## Nested: p1/N
ntk1 <- with(FE,
TukeyC.nest(x=dm,
y=y,
model='y ~ blk + N*P*K',
which='N:P',
fl2=1))
summary(ntk1)
Run the code above in your browser using DataLab