QUESTION 1 (2.24)

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)
machine12<-cbind(Machine1,Machine2) 
machiceAB<- as.data.frame(machine12) 

Question 1a)

Stating the Hypothesis

The Null hypothesis is that Machine 1 and Machine 2 is 16 that is Ho:u1=u2 or u1=u2

Alternative Hypothesis means that Machine 1 and Machine 2 is not 16 that is Ha: u1\("\neq"\) u2 meaning u1\("\neq"\) u2

{r,warning=FALSE}

Question 1b

Testing this hypothesis at an alpha level of 0.05

t.test(machiceAB$Machine1,machiceAB$Machine2,var.equal=TRUE)
## 
##  Two Sample t-test
## 
## data:  machiceAB$Machine1 and machiceAB$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

Question 1b

Since the p-value of our model p-value = 0.4347 is greater than our reference value of significance (alpha=0.05) is , we fail to reject the null hypothesis, stating that both machine samples are equal .

Question 1c

The p value of the test is 0.4347

Question 1d

The 95 percent confidence interval on the difference in mean fill volume for the two machines is

-0.01629652<u1-u2<0.03629652

Question 2.26 a

Type<- c("Type1","Type1","Type1","Type1","Type1","Type1","Type1","Type1","Type1","Type1","Type2","Type2","Type2","Type2","Type2","Type2","Type2","Type2","Type2","Type2")
dat1<- c(65,81,57,66,82,82,67,59,75,70,64,71,83,59,65,56,69,74,82,79)
dat2 <- cbind(Type,dat1)
dat3<- as.data.frame(dat2)
dat3$Type <- as.factor(dat3$Type)
dat3$dat1 <- as.numeric(dat3$dat1)

Using levene’s test to prove equality of variance

library(lawstat)
levene.test(dat3$dat1,dat3$Type,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:  dat3$dat1
## Test Statistic = 0.0014598, p-value = 0.9699

Since the p-value obtained from our model is 0.9699 which is greater than our reference level (alpha=0.05)

We accept the null hypothesis stating that the variances are equal.

QUESTION 2B

Since we have confirmed the equality in variance using the Levene’s test, We can now use the two sample t-test to test for the hypothesis

u1= Type 1

u2= Type 2

The Null hypothesis- Ho: u1=u2 u1=u2

Alternative hypothesis- Ha: u1\("\neq"\) u2 meaning u1\("\neq"\) u2

library(dplyr)
data1<- dat3 %>% filter(Type=="Type1") %>% select (dat1) 
data2<- dat3 %>% filter(Type=="Type2") %>% select(dat1)
t.test(data1,data2,var.equal= TRUE)
## 
##  Two Sample t-test
## 
## data:  data1 and data2
## 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

Since the p value obtained from our model is 0.9622 which is greater than our reference alpha level(0.05)

We are accepting our Null hypothesis stating that the mean burning time is equal.

b). p value obtained from our model is 0.9622

QUESTION 2.29

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)
dat<-cbind(thick100,thick95)
dat1<- as.data.frame(dat)

let

u1= mean of thickness 95

u2= mean of thickness 100

The Null hypothesis- Ho: u1=u2, u1=u2

Alternative hypothesis- Ha: u1\("\neq"\) u2 meaning u1\("\neq"\) u2

Using the two sample t-test we have

t.test(thick100,thick95,var.equal=TRUE, alternative="less")
## 
##  Two Sample t-test
## 
## data:  thick100 and thick95
## t = -2.6751, df = 14, p-value = 0.009059
## alternative hypothesis: true difference in means is less than 0
## 95 percent confidence interval:
##        -Inf -0.8608158
## sample estimates:
## mean of x mean of y 
##  6.846625  9.366625

Since the p-value is 0.009059 which is less than our reference value of alpha

We are rejecting the Null hypothesis which means that the Mean thickness 100 is lower than the mean thickness 95.

QUESTION 2.29 b

the p- value is 0.009059

Question 2.29 c

A 95 percent confidence interval on the difference in the mean is

0.8608158<u1-u2<infinity

From the data obtained we can say that

The lower confidence bound is greater than zero, therefore there is a difference between the two temperature on the thickness of the photo-resist.

Question 2.29 e

Checking for Normality

qqnorm(dat1$thick100,main="NPP for thick 100")
qqline(dat1$thick100)

qqnorm(dat1$thick95,main="NPP for thick 95")
qqline(dat1$thick95)

FROM the plots above we can see that the data points fairly falls on straight line .

We can therefore make conclusions that it approximately follows a normal distribution.