Homework Week II

Question 2.24:

## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
  1. The hypotheses are: H1: mu1 = mu2 = 16 => mu1 - mu2 = 0; H2: mu1 != mu2;
  2. Based on the following tests, we can reject the hypothesis because the means have a difference bigger than 0.05.
#normal plot
qqnorm(machine1, main="Machine 1")
qqline(machine1)

qqnorm(machine2, main="Machine 2")
qqline(machine2)

#checking the standard deviation.
sd(machine1)
## [1] 0.0302765
sd(machine2)
## [1] 0.0254951
#checking variance =, box plot
boxplot(machine1,machine2, names = c('Machine 1' , "Machine 2"),ylab = "Ounces", main = "Plastic Fillers Machines")

#t test
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
  1. P-value: 0.4347
  2. 95% confidence interval:-0.01629652 to 0.03629652

Question 2.26:

a)Test for variances equals, p-value = 0.9699

#levenes test
?levene.test()
## starting httpd help server ... done
levene.test(data, type, location="mean", trim.alpha = 0.05)
## 
##  Classical Levene's test based on the absolute deviations from the mean
##  ( none not applied because the location is not set to median )
## 
## data:  data
## Test Statistic = 0.0014598, p-value = 0.9699
  1. Based on the following data and charts, we can see that the data is normalized and the p-values is 0.9699 which is evidence to not reject the hypothesis(mu1 = mu2). And the difference between the means is not significant.
#normal plot to see the data.
qqnorm(type1, main="Type 1")
qqline(type1)

qqnorm(type2, main="Type 2")
qqline(type2)

#checking variance =, box plot
boxplot(type1,type2, names = c("Type 1" , "Type 2"),ylab = "Burning time Box Plot", main = "Burning time")

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

Question 2.29:

The Hypothesis are: H0 is the mean of the photoresist thickness 95 degrees is equals to the mean of the 100 degrees. H1 is the mean of photoresist thickness 95 degrees is different to the mean of 100 degrees.

  1. By the p-value equals to 0.9946 we can not reject H0 and can not assume the alternative hypothesis.

  2. p-value = 0.99465

  3. 95 percent confidence interval: -Inf 4.629225

  4. The data follows a straight line, we can assume that the data is normalized

#normal plot - e)
qqnorm(data95c, main="95 Celsius")
qqline(data95c)

qqnorm(data100c, main="100 Celsius")
qqline(data100c)

#checking variance =, box plot
boxplot(data95c, data100c, names = c('95 Degrees Celsius' , "100 Degrees Celsius"),ylab = "Photoresist", main = "Box Plot")

#t test
t.test(data95c, data100c, alternative="less")
## 
##  Welch Two Sample t-test
## 
## data:  data95c and data100c
## t = 2.9443, df = 13.731, p-value = 0.9946
## alternative hypothesis: true difference in means is less than 0
## 95 percent confidence interval:
##      -Inf 4.629225
## sample estimates:
## mean of x mean of y 
##  9.366625  6.471625