This report captures work done for the individual homework for Week 2. R code along with the results are provided. The required homework problems were taken from “Design and Analysis of Experiments 8th Edition”: 1) 2.24 2) 2.26a (using Levene’s Test) and 2.26b 3) 2.29a, 2.29b, 2.29c, 2.29e
Questions asked during the assignment are in green and the answers to the questions are in purple.
Machine1 <- c(16.03,16.04,16.05,16.05,16.02,16.01,15.96,15.98,16.02,15.99)
Machine2 <- c(16.02,15.97,15.96,16.01,15.99,16.03,16.04,16.02,16.01,16.00)
Machines <- cbind(Machine1,Machine2)
The test for normalcy isn’t required because the problem states that Machines 1 & 2 are normally distributed.
The problem provides the standard deviations for both machines and when squared they provide the variances. The variances for both Machines are considered to be “equal enough” to proceed with the 2-sample T test. Variance for Machine 1 \(\approx\) .000225 and the variance for Machine 2 \(\approx\) .000324.
The null and alternative hyptheses are tested with an α = 0.05:
H0:μ1 = μ2
Ha:μ1 ≠ μ2
where μ1 = Machine 1 Fill Net Volume and μ2 = Machine 2 Fill Net Volume
OUTPUT 1
t.test(Machine1,Machine2, var.equal = TRUE)
##
## Two Sample t-test
##
## data: Machine1 and Machine2
## t = 0.79894, df = 18, p-value = 0.4347
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -0.01629652 0.03629652
## sample estimates:
## mean of x mean of y
## 16.015 16.005
With a p-value = .4347, we fail to reject the Null hypothesis and conclude that there is no statistically significant difference in the two fill volumes of the machines.
The p-value can be found above in “OUTPUT 1” and is = .4347.
The 95% confidence interval in mean fill volume for the two machines can be found above in “OUTPUT 1” and is: -0.01629652 to 0.03629652.
BurningTime <- c(65,81,57,66,82,82,67,59,75,70,64,71,83,59,65,56,69,74,82,79)
FlareType <- c(1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2)
Flares <- cbind(BurningTime,FlareType)
Before running the test for equal variances, let’s look at a side-by-side boxplot to visually compare the two samples:
boxplot(FlareType1,
FlareType2, main = "Box Plot of Chemical Flare Burning Times (in min.)", names = c("Type 1","Type 2"), col = c("Blue","Red"), ylab = "Minutes")
The variances show in the box plots look similar.
Now let’s formally test the hypotheses for the equal variances (Levene’s Test).
The null and alternative hyptheses are tested with an α = 0.05:
H0: σ12 = σ22 Ha: σ12 ≠ σ22
Where σ12 is the variance for Flare Type 1 Burning Times and σ22 is the variance for Flare Type 2 Burning Times.
The Levene’s test produces the following results:
levene.test(BurningTime,FlareType, location="mean")
##
## Classical Levene's test based on the absolute deviations from the mean
## ( none not applied because the location is not set to median )
##
## data: BurningTime
## Test Statistic = 0.0014598, p-value = 0.9699
Therefore because the p-value is greater than .05 and is actually approaching 1, see above, we fail to reject the Null hypothesis. There is no statistically significant difference in the variances of the burning times of the two flare types.
The hypotheses for the equal mean burning times.
The null and alternative hyptheses are tested with an α = 0.05:
H0:μ1 = μ2
Ha:μ1 ≠ μ2
where μ1 = Flare Type 1 Burning Time and
μ2 = Flare Type 1 Burning Time. All times are in minutes.
We can quickly test visually whether the two samples are normally distributed.
qqnorm(FlareType1,
main = "Normal Probability Plot for Flare Type 1 Burning Times (in minutes)", pch = 21, cex = 2, col = "black", bg = "Red", lwd = 2)
qqline(FlareType1, lwd = 2)
qqnorm(FlareType2,
main = "Normal Probability Plot for Flare Type 2 Burning Times (in minutes)", pch = 21, cex = 2, col = "black", bg = "Blue", lwd = 2)
qqline(FlareType2, lwd = 2)
The two normality plots show that the data is close to the normal distribution so now that we’ve met the normal and equal variance considerations, we will compare the means using a 2-Sample T-test using pooled variance.
OUTPUT 2
t.test(FlareType1,FlareType2, var.equal = TRUE)
##
## Two Sample t-test
##
## data: FlareType1 and FlareType2
## t = 0.048008, df = 18, p-value = 0.9622
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -8.552441 8.952441
## sample estimates:
## mean of x mean of y
## 70.4 70.2
The p-value as shown in “OUTPUT 2” is 0.9622, and with an alpha of 0.05, we fail to reject the Null hypothesis. There is no statistically significant difference in the two means.
Thickness <- c(11.176,7.089,8.097,11.739,11.291,10.759,6.467,8.315,5.263,6.748,7.461,7.015,8.133,7.418,3.772,8.963)
BakingTemp <- c(95,95,95,95,95,95,95,95,100,100,100,100,100,100,100,100)
Wafers <- cbind(Thickness,BakingTemp)
To answer the question above, we will need to conduct a 2-Sample T-test., but before we run the test, we must satisfy the requirements for normality and equal variances.
Let’s first look at Normality by running a Normal Probability Plot for each baking temperature
qqnorm(BakingAt95,
main = "Normal Probability Plot for Photoresist Thickness(in kA) for Baking at 95°C", pch = 21, cex = 2, col = "black", bg = "Red", lwd = 2)
qqline(BakingAt95, lwd = 2)
qqnorm(BakingAt100,
main = "Normal Probability Plot for Photoresist Thickness(in kA) for Baking at 95°C", pch = 21, cex = 2, col = "black", bg = "Blue", lwd = 2)
qqline(BakingAt100, lwd = 2)
(e) The two normality plots show that the data isn’t perfectly normal, but “close” to the normal distribution.
So now that we’ve met the normality consideration, let’s test to see if the variances are equal for the two baking temperatures.
Before running the test for equal variances, let’s look at a side-by-side boxplot to visually compare the two samples:
boxplot(BakingAt95,
BakingAt100, main = "Box Plot of Thicknesses for Two Different Baking Temperatures", names = c("95°C","100°C"), col = c("Blue","Red"), ylab = "Thickness in kA")
The variance for 95°C looks to be roughly twice the size as the variance for 100°C.
Now let’s formally test the hypotheses for the equal variances (Levene’s Test).
The null and alternative hyptheses are tested with an α = 0.05:
H0: σ12 = σ22 Ha: σ12 ≠ σ22
Where σ12 is the variance for Thicknesses at 95°C and σ22 is the variance for Thicknesses at 100°C.
The Levene’s test produces the following results:
levene.test(Thickness,BakingTemp, location="mean")
##
## Classical Levene's test based on the absolute deviations from the mean
## ( none not applied because the location is not set to median )
##
## data: Thickness
## Test Statistic = 2.5625, p-value = 0.1317
Therefore because the p-value is greater than .05, see above, we fail to reject the Null hypothesis. There is no statistically significant difference in the variances of the thicknesses of the two baking temperatures.
The hypotheses for the equal mean thicknesses is a one-sided test because the question asked to determine if there is evidence to support the claim that the higher baking temperature results in wafers with a lower mean photoresist thickness. Had the question asked whether the thicknesses were different than a two-sided test would have been used.
The null and alternative hyptheses are tested with an α = 0.05:
H0:μ1 ≥ μ2
Ha:μ1 < μ2
where μ1 = Photoresist thickness for 95°C baking temperature and
μ2 = Photoresist thickness for 100°C baking temperature.
All thicknesses are in kA.
We now test for a difference in the means.
OUTPUT 3
t.test(BakingAt95,BakingAt100, var.equal = TRUE, alternative = c("greater"))
##
## Two Sample t-test
##
## data: BakingAt95 and BakingAt100
## t = 2.6751, df = 14, p-value = 0.009059
## alternative hypothesis: true difference in means is greater than 0
## 95 percent confidence interval:
## 0.8608158 Inf
## sample estimates:
## mean of x mean of y
## 9.366625 6.846625
(a & b) The p-value as shown in “OUTPUT 3” is 0.009059, and with an alpha of 0.05, we reject the Null hypothesis. The higher baking temperature (100°C) does in fact result in wafers with a lower mean photoresist thickness.
(c) The 95% confidence interval on the difference in means is shown above in “OUTPUT 3”. From a practical perspective, this means that one can be 95% certain that the wafers baked at the 95°C temperature will have at least 0.8608158 kA greater thickness than those baked at the 100°C temperature.
(e) is above in the ‘Normality’ section.