Question 2.32)
Inspector <- c (1:12)
Inspector <- as.character(Inspector)
Caliper1 <- 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)
Caliper2 <- 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)
dat1 <- cbind(Inspector,Caliper1,Caliper2)
dat1 <- as.data.frame(dat1)
str(dat1)
## 'data.frame': 12 obs. of 3 variables:
## $ Inspector: chr "1" "2" "3" "4" ...
## $ Caliper1 : chr "0.265" "0.265" "0.266" "0.267" ...
## $ Caliper2 : chr "0.264" "0.265" "0.264" "0.266" ...
dat1$Caliper1 <- as.numeric(dat1$Caliper1)
dat1$Caliper2 <- as.numeric(dat1$Caliper2)
cor(Caliper1,Caliper2)
## [1] 0.1276307
As we can see that both samples have correlation of 0.127 , we can still go with Paired T Test but as correlation value is weak and likely unimportant , hence instead of going with Paired t Test ,Lets check if we can go with Two Sample T Test.
qqnorm(Caliper1,main="NPP for Caliper 1")
qqline(Caliper1)

qqnorm(Caliper2,main="NPP for Caliper 2")
qqline(Caliper2)

boxplot(Caliper1,Caliper2)

As we can see that both the samples are approximately normally distributed , as points fall around the straight line.
We can see that variances does not have significant differneces , hence we can go with the Two Sample T Test
Question a) Is there a significant difference between the means of the population of measurements represented by the two samples? Use α = 0.05
Here we have to test hypotheses that ,
Null Hypthese : Ho : u1-u2= 0
Alternative Hypotheses : Ha : u1-u2=!0
library(dplyr)
t.test(dat1$Caliper1,dat1$Caliper2,alternative="two.sided",var.equal = TRUE)
##
## Two Sample t-test
##
## data: dat1$Caliper1 and dat1$Caliper2
## t = 0.40519, df = 22, p-value = 0.6893
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -0.001029568 0.001529568
## sample estimates:
## mean of x mean of y
## 0.26625 0.26600
Answer :- As from above statistics we can clearly see that p value=0.6893>0.05.Hence we fail to reject NULL Hypotheses . That means there is no significant different in means of two sample collected (u1=u2 : u1-u2=0)
Question b)P value ?
Answer:- P value from above statistics came out to be 0.6893
Question c)Construct 95% confidence interval
Answer :- -0.001029568 < u1 - u2 < 0.001529568
Question 2.34
Q2.34)a) Any evidence to support for difference in mean performance
grider <- c("S1/1","S2/1","S3/1","S4/1","S5/1","S2/1","S2/2","S2/3","S2/4")
K <- c(1.186,1.151,1.322,1.339,1.200,1.402,1.365,1.537,1.559)
L <- c(1.061,0.992,1.063,1.062,1.065,1.178,1.037,1.086,1.052)
mat2 <- cbind(grider,K,L)
dat2 <- as.data.frame(mat2)
dat2$grider <- as.factor(dat2$grider)
dat2$K <- as.numeric(dat2$K)
dat2$L <- as.numeric(dat2$L)
str(dat2)
cor(dat2$K,dat2$L)
Null Hypotheses : Ho : u1=u2 : u1-u2 =0 : d = 0
Alternative Hypotheses : Ha : u1=!u2 : u1-u2=!0 : d=!0
library(dplyr)
grider <- c("S1/1","S2/1","S3/1","S4/1","S5/1","S2/1","S2/2","S2/3","S2/4")
K <- c(1.186,1.151,1.322,1.339,1.200,1.402,1.365,1.537,1.559)
L <- c(1.061,0.992,1.063,1.062,1.065,1.178,1.037,1.086,1.052)
mat2 <- cbind(grider,K,L)
dat2 <- as.data.frame(mat2)
dat2$grider <- as.factor(dat2$grider)
dat2$K <- as.numeric(dat2$K)
dat2$L <- as.numeric(dat2$L)
t.test(dat2$K,dat2$L,alternative="two.sided",paired = TRUE)
##
## Paired t-test
##
## data: dat2$K and dat2$L
## 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
Answer: As we can see pvalue of test is less than 0.05 . Hence we reject Null Hypothese and hence there is no such evidence to prove that mean of both sample are equal
Q2.34) b) What is the pvalue?
Answer: As we can see pvalue of test is 0.0002953
Q2.34) c) 95% confidence interval for difference in mean?
Answer: As we can see from statistics of test , 0.1700423<u1-u2:d< 0.3777355
Q2.34) d) Normaliy Assumption?
qqnorm(dat2$K,main="Karlsruhe Method")
qqline(dat2$K)

qqnorm(dat2$L,main = "Lehigh Method")
qqline(dat2$L)

Answer:As we can see if we ignore some outliers specially from Lehigh Method (The column L ) then we can say that both the sample seems to almost looks like normally distributed as almost all points are alligned in almost a straight line
Q2.34) e) Normaliy Assumption for difference in mean?
qqnorm(dat2$K-dat2$L)
qqline(dat2$K-dat2$L)

Answer:As we can see if we ignore some outliers then we can say that the differnece in mean almost looks like normally distributed as almost all points are alligned in almost a straight line
Q2.34) f)Role of Normality assumption in paired t test?
Answer : As in any t -test, the assumption of normality is of only weak assumptions unlike the equal variance strong assumption. In the paired t -test, the assumption of normality applies to the distribution of the differences of element of sample who are related . That is, the individual sample measurements do not have to be normally distributed, only their difference
Question 2.29
Getting Data
Thick95<-c(11.176,7.089,8.097,11.739,11.291,10.759,6.467,8.315)
Thick100<-c(5.263,6.748,7.461,7.015,8.133,7.418,3.772,8.963)
dat3 <-cbind(Thick100,Thick95)
dat3 <- as.data.frame(dat3)
Question 2.29a) claim that the higher baking temperature(Thick100) results in wafers with a lower mean photoresist thickness than higher baking temperature(Thick95)? Use α = 0.05.
Null hypothesis : u1(mean of thick95) = u2 (mean of thick100) : u1=u2 : u1-u2 =0 :
Alternative Hypotheses : u1(mean of thick95) > u2 (mean of thick100) : u1>u2 : u1-u2>0
We can here go with Two sample t test
t.test(Thick95,Thick100,var.equal = TRUE,alternative = "greater")
##
## Two Sample t-test
##
## data: Thick95 and Thick100
## 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
Answer -: As p value = 0.009 <0.05 , hence we reject Null hypotheses , that means Mean of Thick 100 is lower than mean of Thick95.
Question 2.29b) What is p value?
Answer -: Pvalue from above statistics is 0.009059
Question 2.29c) mean differnece with 95% confidence interval
We can see from above statistics that ,
0.86<u1-u2<infinity
From this we can interpret that ,This lower confidence bound is greater than 0;therefore, there is a difference in the two temperatures on the thickness of the photoresist
Question 2,29e) Check normality
qqnorm(dat3$Thick100,main="NPP for Thick 100")
qqline(dat3$Thick100)

qqnorm(dat3$Thick95, main = "NPP for Thick 95")
qqline(dat3$Thick95)

Answer :- Here we can see the data points on both plot seems to fall almost along a straight line, hence we can say that it is approximately following normal distribution
Question 3f) Find power for detecting actual difference in mean is 2.5KA
library(pwr)
n1 <- length(dat3$Thick100)
n2 <- length(dat3$Thick95)
s1 <- sd(dat3$Thick100)
s2 <- sd(dat3$Thick95)
sp <- sqrt(((n1-1)*s1^2 +(n2-1)*s2^2 )/ (n1+n2-2))
power.t.test(n=8,delta=2.5,sd=sp,sig.level = 0.05,power=NULL,type = "two.sample",alternative = "one.sided")
##
## Two-sample t test power calculation
##
## n = 8
## delta = 2.5
## sd = 1.884034
## sig.level = 0.05
## power = 0.8098869
## alternative = one.sided
##
## NOTE: n is number in *each* group
Answer :- Here we got power as 0.809 i.e 80.98% ~ 81%.
Question 2.27
Getting Data
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)
Source Code
Inspector <- c (1:12)
Inspector <- as.character(Inspector)
Caliper1 <- 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)
Caliper2 <- 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)
dat1 <- cbind(Inspector,Caliper1,Caliper2)
dat1 <- as.data.frame(dat1)
str(dat1)
dat1$Caliper1 <- as.numeric(dat1$Caliper1)
dat1$Caliper2 <- as.numeric(dat1$Caliper2)
cor(Caliper1,Caliper2)
qqnorm(Caliper1,main="NPP for Caliper 1")
qqline(Caliper1)
qqnorm(Caliper2,main="NPP for Caliper 2")
qqline(Caliper2)
boxplot(Caliper1,Caliper2)
library(dplyr)
t.test(dat1$Caliper1,dat1$Caliper2,alternative="two.sided",var.equal = TRUE)
grider <- c("S1/1","S2/1","S3/1","S4/1","S5/1","S2/1","S2/2","S2/3","S2/4")
K <- c(1.186,1.151,1.322,1.339,1.200,1.402,1.365,1.537,1.559)
L <- c(1.061,0.992,1.063,1.062,1.065,1.178,1.037,1.086,1.052)
mat2 <- cbind(grider,K,L)
dat2 <- as.data.frame(mat2)
dat2$grider <- as.factor(dat2$grider)
dat2$K <- as.numeric(dat2$K)
dat2$L <- as.numeric(dat2$L)
str(dat2)
cor(dat2$K,dat2$L)
library(dplyr)
grider <- c("S1/1","S2/1","S3/1","S4/1","S5/1","S2/1","S2/2","S2/3","S2/4")
K <- c(1.186,1.151,1.322,1.339,1.200,1.402,1.365,1.537,1.559)
L <- c(1.061,0.992,1.063,1.062,1.065,1.178,1.037,1.086,1.052)
mat2 <- cbind(grider,K,L)
dat2 <- as.data.frame(mat2)
dat2$grider <- as.factor(dat2$grider)
dat2$K <- as.numeric(dat2$K)
dat2$L <- as.numeric(dat2$L)
t.test(dat2$K,dat2$L,alternative="two.sided",paired = TRUE)
qqnorm(dat2$K,main="Karlsruhe Method")
qqline(dat2$K)
qqnorm(dat2$L,main = "Lehigh Method")
qqline(dat2$L)
qqnorm(dat2$K-dat2$L)
qqline(dat2$K-dat2$L)
Thick95<-c(11.176,7.089,8.097,11.739,11.291,10.759,6.467,8.315)
Thick100<-c(5.263,6.748,7.461,7.015,8.133,7.418,3.772,8.963)
dat3 <-cbind(Thick100,Thick95)
library(pwr)
dat3 <- as.data.frame(dat3)
t.test(Thick95,Thick100,var.equal = TRUE,alternative = "greater")
qqnorm(dat3$Thick100,main="NPP for Thick 100")
qqline(dat3$Thick100)
qqnorm(dat3$Thick95, main = "NPP for Thick 95")
qqline(dat3$Thick95)
n1 <- length(dat3$Thick100)
n2 <- length(dat3$Thick95)
s1 <- sd(dat3$Thick100)
s2 <- sd(dat3$Thick95)
sp <- sqrt(((n1-1)*s1^2 +(n2-1)*s2^2 )/ (n1+n2-2))
power.t.test(n=8,delta=2.5,sd=sp,sig.level = 0.05,power=NULL,type = "two.sample",alternative = "one.sided")
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)