Pattern of means: 18, 19, 19, 20
means.min<-c(18,19,19,20)
var(means.min)
## [1] 0.6666667
power.anova.test(groups=4,between.var=var(means.min),within.var=3.5,sig.level=0.05,power=0.80)
##
## Balanced one-way analysis of variance power calculation
##
## groups = 4
## n = 20.08368
## between.var = 0.6666667
## within.var = 3.5
## sig.level = 0.05
## power = 0.8
##
## NOTE: n is number in each group
The required number of each sample to be collected is 21 samples per fluid in the case of Min variability.
Pattern of means: 18, 18.667, 19.333, 20
means.int<-c(18,18.667,19.333,20)
var(means.int)
## [1] 0.7405927
power.anova.test(groups=4,between.var=var(means.int),within.var=3.5,sig.level=0.05,power=0.80)
##
## Balanced one-way analysis of variance power calculation
##
## groups = 4
## n = 18.18209
## between.var = 0.7405927
## within.var = 3.5
## sig.level = 0.05
## power = 0.8
##
## NOTE: n is number in each group
The required number of each sample to be collected is 19 samples per fluid in the case of Intermediate variability.
Pattern of means: 18, 18, 20, 20
means.max<-c(18,18,20,20)
var(means.max)
## [1] 1.333333
power.anova.test(groups=4,between.var=var(means.max),within.var=3.5,sig.level=0.05,power=0.80)
##
## Balanced one-way analysis of variance power calculation
##
## groups = 4
## n = 10.56952
## between.var = 1.333333
## within.var = 3.5
## sig.level = 0.05
## power = 0.8
##
## NOTE: n is number in each group
The required number of each sample to be collected is 11 samples per fluid in the case of Max variability.
fluid1=c(17.6,18.9,16.3,17.4,20.1,21.6)
fluid2=c(16.9,15.3,18.6,17.1,19.5,20.3)
fluid3=c(21.4,23.6,19.4,18.5,20.5,22.3)
fluid4=c(19.3,21.1,16.9,17.5,18.3,19.8)
dat<-data.frame(fluid1,fluid2,fluid3,fluid4)
library(tidyr)
dat<-pivot_longer(dat,c(fluid1,fluid2,fluid3,fluid4))
aov.model<-aov(value~name,data=dat)
summary(aov.model)
## Df Sum Sq Mean Sq F value Pr(>F)
## name 3 30.17 10.05 3.047 0.0525 .
## Residuals 20 65.99 3.30
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Since p-value = 0.0525 is less than alpha = 0.10, we reject H0. There is sufficient evidence to conclude that the mean effective lives of the four insulating fluids are not all equal.
plot(aov.model)
The residuals versus fitted values plot does not show a strong pattern or significant change in variance. The Q-Q plot is also approximately linear. Therefore, the ANOVA assumptions appear to be reasonable and the model appears to be adequate.
TukeyHSD(aov.model,conf.level=0.90)
## Tukey multiple comparisons of means
## 90% family-wise confidence level
##
## Fit: aov(formula = value ~ name, data = dat)
##
## $name
## diff lwr upr p adj
## fluid2-fluid1 -0.7000000 -3.2670196 1.8670196 0.9080815
## fluid3-fluid1 2.3000000 -0.2670196 4.8670196 0.1593262
## fluid4-fluid1 0.1666667 -2.4003529 2.7336862 0.9985213
## fluid3-fluid2 3.0000000 0.4329804 5.5670196 0.0440578
## fluid4-fluid2 0.8666667 -1.7003529 3.4336862 0.8413288
## fluid4-fluid3 -2.1333333 -4.7003529 0.4336862 0.2090635
plot(TukeyHSD(aov.model,conf.level=0.90))
Using Tukey’s test with a familywise error rate of alpha = 0.10, Fluids 2 and 3 have significantly different mean effective lives. None of the other pairs are significantly different.
means.min<-c(18,19,19,20)
var(means.min)
power.anova.test(groups=4,between.var=var(means.min),within.var=3.5,sig.level=0.05,power=0.80)
means.int<-c(18,18.667,19.333,20)
var(means.int)
power.anova.test(groups=4,between.var=var(means.int),within.var=3.5,sig.level=0.05,power=0.80)
means.max<-c(18,18,20,20)
var(means.max)
power.anova.test(groups=4,between.var=var(means.max),within.var=3.5,sig.level=0.05,power=0.80)
fluid1=c(17.6,18.9,16.3,17.4,20.1,21.6)
fluid2=c(16.9,15.3,18.6,17.1,19.5,20.3)
fluid3=c(21.4,23.6,19.4,18.5,20.5,22.3)
fluid4=c(19.3,21.1,16.9,17.5,18.3,19.8)
dat<-data.frame(fluid1,fluid2,fluid3,fluid4)
library(tidyr)
dat<-pivot_longer(dat,c(fluid1,fluid2,fluid3,fluid4))
aov.model<-aov(value~name,data=dat)
summary(aov.model)
plot(aov.model)
TukeyHSD(aov.model,conf.level=0.90)
plot(TukeyHSD(aov.model,conf.level=0.90))