Problem 2.27

For this problem, our null hypothesis is that the mean flow rates of the two population are equal. The alternative hypothesis is that the mean flow rates of the two populations are unequal.
flow125 <- c(2.7,4.6,2.6,3.0,3.2,3.8)
flow200 <- c(4.6,3.4,2.9,3.5,4.1,5.1)
wilcox.test(flow125,flow200)
## Warning in wilcox.test.default(flow125, flow200): cannot compute exact p-value
## with ties
## 
##  Wilcoxon rank sum test with continuity correction
## 
## data:  flow125 and flow200
## W = 9.5, p-value = 0.1994
## alternative hypothesis: true location shift is not equal to 0
The p-value = 0.1994, which is much larger than 0.05. This implies that we cannot reject the null hypothesis that the mean flow rates are equal. In turn, this means that we cannot say that the flow rate affects average etch uniformity.

Problem 2.29

d95 <- c(11.176,7.089,8.097,11.739,11.291,10.759,6.467,8.315)
d100 <- c(5.263,6.748,7.461,7.015,8.133,7.418,3.772,8.963)
qqnorm(d95,main="NPP of 95 Degrees")

qqnorm(d100,main="NPP of 100 Degrees")

library(pwr)
## Warning: package 'pwr' was built under R version 4.0.5
sd95 <- sd(d95)
sd100 <- sd(d100)
sp <- sqrt((((8-1)*sd95^2)+((8-1)*sd100^2))/(8+8-2))
es = 2.5/sp # effect size
pwr.t.test(n=8,d=es,sig.level=0.05,power=NULL,type="two.sample")
## 
##      Two-sample t test power calculation 
## 
##               n = 8
##               d = 1.32694
##       sig.level = 0.05
##           power = 0.6945872
##     alternative = two.sided
## 
## NOTE: n is number in *each* group
The normal probability plots show that normality cannot be assumed in this population. The power is 0.6945872.

Problem 2.32

The null hypothesis is that the means are equal, and the alternative hypothesis is that the means are unequals.
c1 <- c(0.265,0.265,0.266,0.267,0.267,0.265,0.267,0.267,0.265,0.268,0.268,0.265)
c2 <- c(0.264,0.265,0.264,0.266,0.267,0.268,0.264,0.265,0.265,0.267,0.268,0.269)
t.test(c1,c2,paired=TRUE,var.equal=TRUE)
## 
##  Paired t-test
## 
## data:  c1 and c2
## t = 0.43179, df = 11, p-value = 0.6742
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.001024344  0.001524344
## sample estimates:
## mean of the differences 
##                 0.00025
sd1 <- sd(c1)
sd2 <- sd(c2)
sp <- sqrt((((12-1)*sd1^2)+((12-1)*sd2^2))/(12+12-2))
mean(c1)-mean(c2)-(2.074*sp*sqrt(1/6)) # lower bound of confidence interval
## [1] -0.001029646
mean(c1)-mean(c2)+(2.074*sp*sqrt(1/6)) # upper bound of confidence interval
## [1] 0.001529646
The mean of the differences is a small value, virtually zero. This would imply that we cannot reject the null hypothesis. This is supported by the calculated p-value = 0.6742, implying that we cannot reject the null hypothesis at any level of significance. The 95 percent confidence interval on the difference in mean diameter measurements extends from -0.00103 to 0.00153.

Problem 2.34

The null hypothesis is that the difference in means is zero, and the alternative hypothesis is that the difference in means is not zero.
km <- c(1.186,1.151,1.322,1.339,1.200,1.402,1.365,1.537,1.559)
lm <- c(1.061,0.992,1.063,1.062,1.065,1.178,1.037,1.086,1.052)
t.test(km,lm,paired=TRUE)
## 
##  Paired t-test
## 
## data:  km and lm
## t = 6.0819, df = 8, p-value = 0.0002953
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  0.1700423 0.3777355
## sample estimates:
## mean of the differences 
##               0.2738889
qqnorm(km,main="Karlsruhe Method")

qqnorm(lm,main="Lehigh Method")

qqnorm(km-lm,main="Difference in Ratios")

The mean of the differences is 0.2738889, which is not significant enough to state that there is a difference in mean performance. This decision is supported by the p-value from the paired t-test, which is 0.0002953. This p-value is much less than 0.05, implying that the null hypothesis can be rejected. The 95 percent confidence interval extends from 0.1700423 to 0.3777355. The first sample cannot be assumed to be normally distributed, based off the right-skewedness that can be seen in its normal probability plot(NPP). However, the second sample’s NPP implies that the distribution is much closer to normality than the first sample.The normality assumption for the difference in ratios appears to be strong, with the respective NPP being more evenly distributed than the two individual samples. The normality assumption in the paired t-test is important because it allows us to cancel out the block effects on the samples. Cancelling out the block effects results in a narrower confidence interval, meaning that the obtained results are more precise.
flow125 <- c(2.7,4.6,2.6,3.0,3.2,3.8)
flow200 <- c(4.6,3.4,2.9,3.5,4.1,5.1)
wilcox.test(flow125,flow200)
d95 <- c(11.176,7.089,8.097,11.739,11.291,10.759,6.467,8.315)
d100 <- c(5.263,6.748,7.461,7.015,8.133,7.418,3.772,8.963)
qqnorm(d95,main="NPP of 95 Degrees")
qqnorm(d100,main="NPP of 100 Degrees")
library(pwr)
sd95 <- sd(d95)
sd100 <- sd(d100)
sp <- sqrt((((8-1)*sd95^2)+((8-1)*sd100^2))/(8+8-2))
es = 2.5/sp # effect size
pwr.t.test(n=8,d=es,sig.level=0.05,power=NULL,type="two.sample")
c1 <- c(0.265,0.265,0.266,0.267,0.267,0.265,0.267,0.267,0.265,0.268,0.268,0.265)
c2 <- c(0.264,0.265,0.264,0.266,0.267,0.268,0.264,0.265,0.265,0.267,0.268,0.269)
t.test(c1,c2,paired=TRUE,var.equal=TRUE)
sd1 <- sd(c1)
sd2 <- sd(c2)
sp <- sqrt((((12-1)*sd1^2)+((12-1)*sd2^2))/(12+12-2))
mean(c1)-mean(c2)-(2.074*sp*sqrt(1/6)) # lower bound of confidence interval
mean(c1)-mean(c2)+(2.074*sp*sqrt(1/6)) # upper bound of confidence interval
km <- c(1.186,1.151,1.322,1.339,1.200,1.402,1.365,1.537,1.559)
lm <- c(1.061,0.992,1.063,1.062,1.065,1.178,1.037,1.086,1.052)
t.test(km,lm,paired=TRUE)
qqnorm(km,main="Karlsruhe Method")
qqnorm(lm,main="Lehigh Method")
qqnorm(km-lm,main="Difference in Ratios")