power.anova.test(groups=4,n=NULL,
between.var=var(c(18,19,19,20)),
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
power.anova.test(groups=4,n=NULL,
between.var=var(c(18,18.67,19.33,20)),
within.var=3.5,
sig.level=0.05,power=0.80)
##
## Balanced one-way analysis of variance power calculation
##
## groups = 4
## n = 18.21285
## between.var = 0.7392667
## within.var = 3.5
## sig.level = 0.05
## power = 0.8
##
## NOTE: n is number in each group
power.anova.test(groups=4,n=NULL,
between.var=var(c(18,18,20,20)),
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
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)
dat
## Fluid1 Fluid2 Fluid3 Fluid4
## 1 17.6 16.9 21.4 19.3
## 2 18.9 15.3 23.6 21.1
## 3 16.3 18.6 19.4 16.9
## 4 17.4 17.1 18.5 17.5
## 5 20.1 19.5 20.5 18.3
## 6 21.6 20.3 22.3 19.8
library(tidyr)
dat<-pivot_longer(dat,c(Fluid1,Fluid2,Fluid3,Fluid4))
dat
## # A tibble: 24 × 2
## name value
## <chr> <dbl>
## 1 Fluid1 17.6
## 2 Fluid2 16.9
## 3 Fluid3 21.4
## 4 Fluid4 19.3
## 5 Fluid1 18.9
## 6 Fluid2 15.3
## 7 Fluid3 23.6
## 8 Fluid4 21.1
## 9 Fluid1 16.3
## 10 Fluid2 18.6
## # ℹ 14 more rows
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
2-a. Null Hypothesis: The mean lives of all four insulating fluids are the same. Alternative Hypothesis: The mean lives of the four insulating fluids are not all the same. Since the p-value (0.0525) is less than α = 0.10, we reject the null hypothesis. There is sufficient evidence to conclude that at least one fluid has a different mean life.
plot(aov.model)
2-b. The residual plots do not show any obvious patterns, and the residuals are approximately normally distributed based on the Q-Q plot. The variability also appears reasonably constant across the groups. Therefore, the ANOVA 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))
2-c. At a familywise error rate of 0.10, only Fluid 2 and Fluid 3 are significantly different (adjusted p-value = 0.0441). Fluid 3 has a significantly higher mean life than Fluid 2. All other pairwise comparisons are not significant.