Setup

Load Libraries Into Session

# setup Libraries
library(dplyr)
library(knitr)
library(agricolae)
library(kableExtra)
library(tidyr)

Problem 3.23

The effective life of insulating fluids at an accelerated load of 35kV is being studied. Test data have been obtained for the four types of fluid. The results from a completely randomized experiment were as follows:

Life Under 35kV Load for Different Fluid Types
FluidType 1 2 3 4 5 6
1 17.6 18.9 16.3 17.4 20.1 21.6
2 16.9 15.3 18.6 17.1 19.5 20.3
3 21.4 23.6 19.4 18.5 20.5 22.3
4 19.3 21.1 16.9 17.5 18.3 19.8

Part (a)

Is there any indication that the fluids differ? Use \(\alpha=0.05\).

Hypotheses

\(H_0: \mu_1 = \mu_2 = \mu_3 = \mu_4\)

\(H_a\): at least one \(\mu_i\) differs from the other \(\mu_i\)’s.

Setting up Data Frame for Part (a)

Type1 <- c(17.6,18.9,16.3,17.4,20.1,21.6)
Type2 <- c(16.9,15.3,18.6,17.1,19.5,20.3)
Type3 <- c(21.4,23.6,19.4,18.5,20.5,22.3)
Type4 <- c(19.3,21.1,16.9,17.5,18.3,19.8)

FluidTableb <- data.frame(Type1,Type2,Type3,Type4)
FluidTableLong <- pivot_longer(FluidTableb,c(Type1,Type2,Type3,Type4))

Running Analysis of Variance for Part (b)

FluidLifeAOV <- aov(value ~ name, data = FluidTableLong)
FluidLifeAOVTable <- summary(FluidLifeAOV)
Df Sum Sq Mean Sq F value Pr(>F)
name 3 30.16500 10.055000 3.047277 0.0524632
Residuals 20 65.99333 3.299667

R calculated a p-value of 0.05246, which is greater than our \(\alpha=0.05\) which means we fail to reject \(H_0\) and conclude that the mean lives of different fluid types are approximately equal. However, this p-value is only slightly greater than our \(\alpha=0.05\), so we do not have significant confidence in our failure to reject \(H_0\).

Part (b)

Which fluid would you select, given that the objective is long life?

Choosing Highest Mean Fluid Life

meanType1 = mean(Type1)
meanType2 = mean(Type2)
meanType3 = mean(Type3)
meanType4 = mean(Type4)

Fluid Type 1 has a mean life of 18.65 hours.

Fluid Type 2 has a mean life of 17.95 hours.

Fluid Type 3 has a mean life of 20.95 hours.

Fluid Type 4 has a mean life of 18.8166667 hours.

Conclusion: Fluid Type 3 has the longest mean life of 20.95 hours, so I would select that fluid type.

Part (c)

Analyze the residuals from this experiment. Are the basic analysis of variance assumptions satisfied?

The following are the model adequacy plots.

Conclusions: The plots show that yes, the basic analysis of variance assumptions are satisfied because they show the data has a normal distribution and constant variance.

Problem 3.28

An experiment was performed to investigate the effectiveness of five insulating materials. Four samples of each material were tested at an elevated voltage level to accelerate the time to failure. The failure times (in minutes) are shown below:

Material 1 2 3 4
1 110 157 194 178
2 1 2 4 18
3 880 1256 5276 4355
4 495 7040 5307 10050
5 7 5 29 2

Part (a)

Do all five materials have the same effect on mean failure time?

Hypotheses

\(H_0: \mu_1 = \mu_2 = \mu_3 = \mu_4 = \mu_5\)

\(H_a\): at least one \(\mu_i\) differs from the other \(\mu_i\)’s.

Setting up Data Frame for Part (a)

Material1 <- c(110,157,194,178)
Material2 <- c(1,2,4,18)
Material3 <- c(880,1256,5276,4355)
Material4 <- c(495,7040,5307,10050)
Material5 <- c(7,5,29,2)

InsulatingTable <- data.frame(Material1,Material2,Material3,Material4,Material5)
InsulatingTableLong <- pivot_longer(InsulatingTable,c(Material1,Material2,Material3,Material4,Material5))

Running Analysis of Variance for Part (a)

InsulatingAOV <- aov(value ~ name, data = InsulatingTableLong)
InsulatingAOVTable <- summary(InsulatingAOV)
Df Sum Sq Mean Sq F value Pr(>F)
name 4 103191489 25797872 6.190929 0.003786
Residuals 15 62505657 4167044

R calculated a p-value of 0.0038, which is much less than an assumed \(\alpha=0.05\) which means we reject \(H_0\) and conclude that at least one of the material’s mean failure times significantly differs from the rest. This means that no, the materials do not have the same effect on mean failure time.

Part (b)

Plot the residuals versus the predicted response. Construct a normal probability plot of the residuals. What information is conveyed by these plots?

Residuals vs Response Plot

Normal Probability Plot

Conclusions: The plots show that the data does not have constant variance and the data is not normally distributed. This means that the basic analysis of variance assumptions are not satisfied.

Part (c)

Based on your answer to part (b) conduct another analysis of the failure time data and draw appropriate conclusions.

We will use the Kruskal-Wallis test and use an assumed \(\alpha=0.05\).

kruskal.test(value~name,data=InsulatingTableLong)
## 
##  Kruskal-Wallis rank sum test
## 
## data:  value by name
## Kruskal-Wallis chi-squared = 16.873, df = 4, p-value = 0.002046

The calculated p-value of \(0.002\) is much smaller than our assumed \(\alpha=0.05\), so we again reject \(H_0\) and conclude that at least one material’s mean of failure times significantly differs from the rest.

Problem 3.29

A semiconductor manufacturer has developed three different methods for reducing particle counts on wafers. All three methods are tested on five different wafers and the after treatment particle count obtained. The data are shown below:

Treatment 1 2 3 4 5
1 31 10 21 4 1
2 62 40 24 30 35
3 53 27 120 97 68

Part (a)

Do all methods have the same effect on mean particle count?

Hypotheses

\(H_0: \mu_1 = \mu_2 = \mu_3\)

\(H_a\): at least one \(\mu_i\) differs from the other \(\mu_i\)’s.

Setting up Data Frame for Part (a)

Method1 <- c(31,10,21,4,1)
Method2 <- c(62,40,24,30,35)
Method3 <- c(53,27,120,97,68)

SemiTable <- data.frame(Method1,Method2,Method3)
SemiTableLong <- pivot_longer(SemiTable,c(Method1,Method2,Method3))

Running Analysis of Variance for Part (a)

SemiAOV <- aov(value ~ name, data = SemiTableLong)
SemiAOVTable <- summary(SemiAOV)
Df Sum Sq Mean Sq F value Pr(>F)
name 2 8963.733 4481.8667 7.913832 0.0064302
Residuals 12 6796.000 566.3333

R calculated a p-value of 0.0064, which is much less than an assumed \(\alpha=0.05\) which means we reject \(H_0\) and conclude that at least one of the method’s mean after-treatment particle counts significantly differs from the rest.

Part (b)

Plot the residuals versus the predicted response. Construct a normal probability plot of the residuals. Are there potential concerns about the validity of the assumptions?

Residuals vs Response Plot

Normal Probability Plot

Conclusions: The plots show that the data does not have constant variance and the data is not normally distributed. This means that the basic analysis of variance assumptions are not satisfied and yes, there are concerns about the validity of the assumptions.

Part (c)

Based on your answer to part (b) conduct another analysis of the particle count data and draw appropriate conclusions.

We will use the Kruskal-Wallis test and use an assumed \(\alpha=0.05\).

kruskal.test(value~name,data=SemiTableLong)
## 
##  Kruskal-Wallis rank sum test
## 
## data:  value by name
## Kruskal-Wallis chi-squared = 8.54, df = 2, p-value = 0.01398

The calculated p-value of \(0.014\) is smaller than our assumed \(\alpha=0.05\), so we again reject \(H_0\) and conclude that at least one of the method’s mean after-treatment particle counts significantly differs from the rest.

Problem 3.51

Use the Kruskal-Wallis test for the experiment in Problem 3.23. Compare the conclusions with those from the usual analysis of variance.

Recall Problem 3.23’s AOV results below:
Df Sum Sq Mean Sq F value Pr(>F)
name 3 30.16500 10.055000 3.047277 0.0524632
Residuals 20 65.99333 3.299667

Running Kruskal-Wallis Test

kruskal.test(value~name,data=FluidTableLong)
## 
##  Kruskal-Wallis rank sum test
## 
## data:  value by name
## Kruskal-Wallis chi-squared = 6.2177, df = 3, p-value = 0.1015

Conclusions: The AOV resulted in a p-value of \(0.05246\), which allowed us to fail to reject \(H_0\). The Kruskal-Wallis Test resulted in a p-value of \(0.102\), meaning we again fail to reject \(H_0\), however we are able to do so at a higher degree of confidence.