Performing two sample t test
knitr::opts_chunk$set(echo = TRUE)
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)
a<-cbind(machine1,machine2)
summary(machine1)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 15.96 15.99 16.02 16.02 16.04 16.05
summary(machine2)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 15.96 15.99 16.01 16.00 16.02 16.04
boxplot(machine1,machine2,main="Boxplot for machine 1 and machine 2")

qqnorm(machine1,main="Normal probability plot for machine 1", ylab = "net quantities in ounces")
qqline(machine1)

qqnorm(machine2,main = "Normal probability plot for machine 2")
qqline(machine2)

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
p value for the test is 0.4347
95% confidence interval is -0.0162 to 0.03629
{"AllCode,eval=FALSE"}
Comment on result-As the p value is greater than 0.05, we can state that we failed to reject the null hypothesis.