# Given information
alpha <- 0.05
sigma2 <- 3.5
a <- 4
target_power <- 0.80
#Minimim Variability
# One mean at each endpoint and the rest at the midpoint.
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
# Intermediate Variability
power.anova.test(groups = 4,n = NULL,between.var = var(c(18, 18.5, 19.5, 20)),within.var = 3.5,sig.level = 0.05,power = 0.80)
##
## Balanced one-way analysis of variance power calculation
##
## groups = 4
## n = 16.27435
## between.var = 0.8333333
## within.var = 3.5
## sig.level = 0.05
## power = 0.8
##
## NOTE: n is number in each group
# Maximum Variability
# Means concentrated at the two endpoints
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
So, from these results, to obtain 80% power at a significance level of 0.05, approximately 21, 17, and 11 observations per fluid are required under the minimum, intermediate, and maximum variability configurations, respectively.
(a) The hypotheses are:
\[H_0: \mu_1 = \mu_2 = \mu_3 = \mu_4 \]\[ H_a: \text{At least one fluid has a different mean life.}\]
# Fluid type
fluid <- factor(rep(1:4, each = 6))
# Life in hours at 35 kV load
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)
fluid_data <- data.frame(fluid, life)
fluid_data
## fluid life
## 1 1 17.6
## 2 1 18.9
## 3 1 16.3
## 4 1 17.4
## 5 1 20.1
## 6 1 21.6
## 7 2 16.9
## 8 2 15.3
## 9 2 18.6
## 10 2 17.1
## 11 2 19.5
## 12 2 20.3
## 13 3 21.4
## 14 3 23.6
## 15 3 19.4
## 16 3 18.5
## 17 3 20.5
## 18 3 22.3
## 19 4 19.3
## 20 4 21.1
## 21 4 16.9
## 22 4 17.5
## 23 4 18.3
## 24 4 19.8
Now, we will fit the data in the one-way ANOVA model.
model <- aov(life ~ fluid, data = fluid_data)
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
From the ANOVA results,
\[F = 3.047\] and \[p = 0.0525.\]
Since \[p = 0.0525 < 0.10,\]
We reject the null hypothesis.
(b)
To check whether the ANOVA model is adequate, we examine the diagnostic
plots of the fitted ANOVA model.
aov.model <- aov(model)
summary(aov.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
plot(aov.model)
Residuals vs Fitted: The residuals are scattered around zero without a strong systematic pattern. This suggests that the constant variance assumption is reasonable.
Normal Q-Q Plot: Most of the residuals lie approximately along the straight reference line. Therefore, the normality assumption appears reasonable.
Scale-Location Plot: There is no strong pattern in the spread of the residuals across the fitted values. This indicates that the variance is approximately constant among the groups.
Residuals vs Leverage: There are no obvious highly influential observations that would seriously affect the fitted model.
Overall, the diagnostic plots do not show any serious violations of the ANOVA assumptions. Therefore, the ANOVA model appears to be adequate for these data.
(c)
Since the ANOVA test indicates that the mean life is not the same for all four fluids, Tukey’s test is used to determine which pairs of fluid means are significantly different.
The familywise error rate is \[\alpha = 0.10\] so the corresponding confidence level is \[1-\alpha = 0.90.\]
TukeyHSD(aov.model, conf.level = 0.90)
## Tukey multiple comparisons of means
## 90% family-wise confidence level
##
## Fit: aov(formula = model)
##
## $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
We can also plot the Tukey simultaneous confidence intervals.
plot(TukeyHSD(aov.model, conf.level = 0.90))
For each pair of fluids, we test \[H_0:\mu_i=\mu_j\] against \[H_a:\mu_i\neq\mu_j.\]
A pair is significantly different if its adjusted p-value is less than 0.10. Equivalently, the 90% Tukey confidence interval for the difference will not contain zero.
From Tukey’s test, Fluid 2 and Fluid 3 are significantly different at the familywise significance level of \(\alpha=0.10\).
The remaining pairwise comparisons are not statistically significant because their adjusted p-values are greater than 0.10 and their 90% confidence intervals contain zero.
So, the significant difference detected by the ANOVA is primarily due to the difference between Fluid 2 and Fluid 3.