library(agricolae)
MixingTech<-c(3129,3000,2865,2890,3200,3300,2975,3150,2800,2900,2985,3050,2600,2700,2600,2765)
a<-c(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4)
str(a)
## num [1:16] 1 1 1 1 2 2 2 2 3 3 ...
a<-as.factor(a)
str(a)
## Factor w/ 4 levels "1","2","3","4": 1 1 1 1 2 2 2 2 3 3 ...
b<-cbind.data.frame(MixingTech,a)
b<-aov(MixingTech~a)
summary(b)
## Df Sum Sq Mean Sq F value Pr(>F)
## a 3 489740 163247 12.73 0.000489 ***
## Residuals 12 153908 12826
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
residual<-MixingTech-a
## Warning in Ops.factor(MixingTech, a): '-' not meaningful for factors
t<-LSD.test(MixingTech,a,12,12826,console=TRUE)
##
## Study: MixingTech ~ a
##
## LSD t Test for MixingTech
##
## Mean Square Error: 12826
##
## a, means and individual ( 95 %) CI
##
## MixingTech std r LCL UCL Min Max
## 1 2971.00 120.55704 4 2847.623 3094.377 2865 3129
## 2 3156.25 135.97641 4 3032.873 3279.627 2975 3300
## 3 2933.75 108.27242 4 2810.373 3057.127 2800 3050
## 4 2666.25 80.97067 4 2542.873 2789.627 2600 2765
##
## Alpha: 0.05 ; DF Error: 12
## Critical Value of t: 2.178813
##
## least Significant Difference: 174.482
##
## Treatments with the same letter are not significantly different.
##
## MixingTech groups
## 2 3156.25 a
## 1 2971.00 b
## 3 2933.75 b
## 4 2666.25 c
plot(b)
### Least significant difference is 174.482
library(agricolae)
CottonWeight<-c(7,7,15,11,9,12,17,12,18,18,14,19,19,18,18,19,25,22,19,23,7,10,11,15,11)
e<-c(1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5)
e<-as.factor(e)
f<-cbind.data.frame(CottonWeight,e)
f<-aov(CottonWeight~e)
summary(f)
## Df Sum Sq Mean Sq F value Pr(>F)
## e 4 475.8 118.94 14.76 9.13e-06 ***
## Residuals 20 161.2 8.06
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
t<-LSD.test(CottonWeight,e,20,8.06,console = TRUE)
##
## Study: CottonWeight ~ e
##
## LSD t Test for CottonWeight
##
## Mean Square Error: 8.06
##
## e, means and individual ( 95 %) CI
##
## CottonWeight std r LCL UCL Min Max
## 1 9.8 3.346640 5 7.151566 12.44843 7 15
## 2 15.4 3.130495 5 12.751566 18.04843 12 18
## 3 17.6 2.073644 5 14.951566 20.24843 14 19
## 4 21.6 2.607681 5 18.951566 24.24843 19 25
## 5 10.8 2.863564 5 8.151566 13.44843 7 15
##
## Alpha: 0.05 ; DF Error: 20
## Critical Value of t: 2.085963
##
## least Significant Difference: 3.745452
##
## Treatments with the same letter are not significantly different.
##
## CottonWeight groups
## 4 21.6 a
## 3 17.6 b
## 2 15.4 b
## 5 10.8 c
## 1 9.8 c
plot(f)
### Least significant difference is 3.745
library(pwr)
pwr.anova.test(k=4,n=NULL,f=2,sig.level=0.05,power=0.90)
##
## Balanced one-way analysis of variance power calculation
##
## k = 4
## n = 2.170367
## f = 2
## sig.level = 0.05
## power = 0.9
##
## NOTE: n is number in each group
library(pwr)
pwr.anova.test(k=4,n=NULL,f=1.66,sig.level=0.05,power=0.90)
##
## Balanced one-way analysis of variance power calculation
##
## k = 4
## n = 2.528053
## f = 1.66
## sig.level = 0.05
## power = 0.9
##
## NOTE: n is number in each group
pwr.anova.test(k=4,n=NULL,f=1.42,sig.level=0.05,power=0.90)
##
## Balanced one-way analysis of variance power calculation
##
## k = 4
## n = 2.959231
## f = 1.42
## sig.level = 0.05
## power = 0.9
##
## NOTE: n is number in each group
```