This report compares the mean lives of four insulating fluids using ANOVA and Tukey’s test.
In this question we have a significance level of 0.05, power of 0.80, and within-group variance of 3.5.
min_means <- c(18, 19, 19, 20)
inter_means <- c(18, 18.66666, 19.33333, 20)
max_means <- c(18, 18,20, 20)
min_size <- power.anova.test(groups = 4, between.var = var(min_means), within.var = 3.5, sig.level = 0.05, power = 0.80)
inter_size <- power.anova.test(groups = 4, between.var = var(inter_means), within.var = 3.5, sig.level = 0.05, power = 0.80)
max_size <- power.anova.test(groups = 4, between.var = var(max_means), within.var = 3.5, sig.level = 0.05, power = 0.80)
sizes <- data.frame(Case = c("Minimum", "Intermediate", "Maximum"), Calculated_n = c(min_size$n, inter_size$n, max_size$n)
)
knitr::kable(sizes, digits = 4)
| Case | Calculated_n |
|---|---|
| Minimum | 20.0837 |
| Intermediate | 18.1786 |
| Maximum | 10.5695 |
Rounding up to the nearest whole number gives 21, 19, and 11 observations per fluid for respectively for the minimum, intermediate, and maximum variability.
\[H_0: \text{The mean life of the fluids is the same.}\]
\[H_a: \text{At least one population mean differs.}\]
Use a significance level of 0.10 and one observation per row.
fluid <- factor(rep(1:4, each = 6))
life <- c(17.6, 18.9, 16.3, 17.4, 20.1, 21.6, 16.9, 15.3, 18.6, 17.1, 19.5, 20.3, 21.4, 23.6, 19.4, 18.5, 20.5, 22.3, 19.3, 21.1, 16.9, 17.5, 18.3, 19.8)
fluids <- data.frame(fluid, life)
aggregate(life ~ fluid, data = fluids, FUN = mean)
## fluid life
## 1 1 18.65000
## 2 2 17.95000
## 3 3 20.95000
## 4 4 18.81667
model <- aov(life ~ fluid, data = fluids)
summary(model)
## Df Sum Sq Mean Sq F value Pr(>F)
## fluid 3 30.16 10.05 3.047 0.0525 .
## Residuals 20 65.99 3.30
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
F-value = 3.047
\(p = 0.0525 < 0.10\).
Hence we reject \(H_0\)
par(mfrow = c(1, 2))
plot(fitted(model), residuals(model),
xlab = "Fitted values", ylab = "Residuals", main = "Residuals vs Fitted", col = "blue")
qqnorm(residuals(model), main = "Q-Q Plot", col = "blue")
qqline(residuals(model), col = "red")
par(mfrow = c(1, 1))
Here we can see that the residual spreads are similar, and the Q-Q plot is aproximetly linear.
Hence we can infer that the model appears to be adequate.
Here we implement a familywise error rate of 0.10.
comparisons <- TukeyHSD(model, conf.level = 0.90)
comparisons
## Tukey multiple comparisons of means
## 90% family-wise confidence level
##
## Fit: aov(formula = life ~ fluid, data = fluids)
##
## $fluid
## diff lwr upr p adj
## 2-1 -0.7000000 -3.2670196 1.8670196 0.9080815
## 3-1 2.3000000 -0.2670196 4.8670196 0.1593262
## 4-1 0.1666667 -2.4003529 2.7336862 0.9985213
## 3-2 3.0000000 0.4329804 5.5670196 0.0440578
## 4-2 0.8666667 -1.7003529 3.4336862 0.8413288
## 4-3 -2.1333333 -4.7003529 0.4336862 0.2090635
plot(comparisons, las = 1, col = "blue")
We see that only fluids 2 and 3 differ significantly when we use the familywise error rate of 0.10