let u1= mean of tensile strength using mixing technique 1
u2= mean of tensile strength using mixing technique 2
u3= mean of tensile strength using mixing technique 3
u4= mean of tensile strength using mixing technique 4
Null hypothesis is that u1=u2=u3=u4
Alternative hypothesis (Ha) is that at least of the u’s differs.
MTechnique<- c("1","1","1","1","2","2","2","2","3","3","3","3","4","4","4","4")
Tdata<- c(3129,3000,2865,2890,3200,3300,2975,3150,2800,2900,2985,3050,2600,2700,2600,2765)
dat<- cbind(MTechnique,Tdata)
dat<- as.data.frame(dat)
dat$Tdata <- as.numeric(dat$Tdata)
dat$MTechnique<- as.factor(dat$MTechnique)
model <- aov(Tdata~MTechnique,data=dat)
summary(model)
## Df Sum Sq Mean Sq F value Pr(>F)
## MTechnique 3 489740 163247 12.73 0.000489 ***
## Residuals 12 153908 12826
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
library(agricolae)
LSD.test(model,"MTechnique",console = TRUE)
##
## Study: model ~ "MTechnique"
##
## LSD t Test for Tdata
##
## Mean Square Error: 12825.69
##
## MTechnique, means and individual ( 95 %) CI
##
## Tdata std r LCL UCL Min Max
## 1 2971.00 120.55704 4 2847.624 3094.376 2865 3129
## 2 3156.25 135.97641 4 3032.874 3279.626 2975 3300
## 3 2933.75 108.27242 4 2810.374 3057.126 2800 3050
## 4 2666.25 80.97067 4 2542.874 2789.626 2600 2765
##
## Alpha: 0.05 ; DF Error: 12
## Critical Value of t: 2.178813
##
## least Significant Difference: 174.4798
##
## Treatments with the same letter are not significantly different.
##
## Tdata groups
## 2 3156.25 a
## 1 2971.00 b
## 3 2933.75 b
## 4 2666.25 c
Using the LSD test
μ1 = μ3 - we fail to reject Null Hypothesis (Ho).
Also
μ2 differs from μ1,μ3, μ4
μ4 differs from μ1,μ2 ,μ3
plot(model)
plot(Tdata, ylab = "Tensile Strength")
From the scatter plot, we can make accurate conclusions that the data is normally distributed because the data follows no specific pattern.
cotton<- c("15","15","15","15","15","20","20","20","20","20","25","25","25","25","25","30","30","30","30","30","35","35","35","35","35")
Obs<- 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)
data1<- cbind(cotton,Obs)
data1 <- as.data.frame(data1)
data1$cotton <- as.factor(data1$cotton)
data1$Obs <- as.numeric(data1$Obs)
model1<- aov(Obs~cotton,data=data1)
summary(model1)
## Df Sum Sq Mean Sq F value Pr(>F)
## cotton 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
library(agricolae)
LSD.test(model1,"cotton",console=TRUE)
##
## Study: model1 ~ "cotton"
##
## LSD t Test for Obs
##
## Mean Square Error: 8.06
##
## cotton, means and individual ( 95 %) CI
##
## Obs std r LCL UCL Min Max
## 15 9.8 3.346640 5 7.151566 12.44843 7 15
## 20 15.4 3.130495 5 12.751566 18.04843 12 18
## 25 17.6 2.073644 5 14.951566 20.24843 14 19
## 30 21.6 2.607681 5 18.951566 24.24843 19 25
## 35 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.
##
## Obs groups
## 30 21.6 a
## 25 17.6 b
## 20 15.4 b
## 35 10.8 c
## 15 9.8 c
let μ1 = mean value of 15% cotton by Weight.
μ2 = mean value of 20% cotton by Weight.
μ3 = mean value of 25% cotton by Weight.
μ4 = mean value of 30% cotton by Weight.
μ5 = mean value of 35% cotton by Weight.
From the LSD test we can conclude that
μ4 is different from μ1,μ2,μ3,μ5
μ1 is similar to μ5 but different from μ2,μ3,μ4
μ2 is similar to μ3 but different from μ1,μ4,μ5
μ3 is similar to μ2 but different from μ1,μ4,μ5
μ5 is similar to μ1 but different from μ2,μ3,μ4
Question 3.10 c
plot(model1)
library(pwr)
## Warning: package 'pwr' was built under R version 4.1.3
pwr.anova.test(k = 4, n = NULL, f = sqrt(((60-50)^2)/25), sig.level = 0.05, power = 0.9)
##
## 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
pwr.anova.test(k = 4, n = NULL, f = sqrt(((60-50)^2)/36), sig.level = 0.05, power = 0.9)
##
## Balanced one-way analysis of variance power calculation
##
## k = 4
## n = 2.518782
## f = 1.666667
## sig.level = 0.05
## power = 0.9
##
## NOTE: n is number in each group
pwr.anova.test(k = 4, n = NULL, f = sqrt(((60-50)^2)/49), sig.level = 0.05, power = 0.9)
##
## Balanced one-way analysis of variance power calculation
##
## k = 4
## n = 2.939789
## f = 1.428571
## sig.level = 0.05
## power = 0.9
##
## NOTE: n is number in each group
An increase in sample size was noted with n=2.93, which would be rounded up to 3 samples in each group.
Question 3.44 c
we can see that based on the analysis obtained by increasing the figures of σ, the number of sample size required simultaneously increases to attain the same power of the test.
Question 3.45 d
The best way to chose n value is to take in account of the number of groups, effect size, and power.
We can also see based on our previous example that increasing the σ value increases the number of samples and decreases the effect size.
And this should be taken into account when choosing n value in practice.