Problem No. 2.26

knitr::opts_chunk$set(echo = TRUE)

As per given data in the problem,

p<-c(65,81,57,66,82,82,67,59,75,70,64,71,83,59,65,56,69,74,82,79)
type<-c("1","1","1","1","1","1","1","1","1","1","2","2","2","2","2","2","2","2","2","2")
dat<-data.frame(p,type)

Now to compare Boxplot of type1 and type2 formulations of burning times(in minutes)of chemical flares

type1<-c(65,81,57,66,82,82,67,59,75,70)
type2<-c(64,71,83,59,65,56,69,74,82,79)
boxplot(type1,type2,main="Boxplot of type1 and type2",names = c("type1", "type2"))

##By comparing the both boxplot, we can state that the variance of type1 and type2 formulations are equal which is also given in the problem

As variance is equal, then by Levene’s test,

library(lawstat)
levene.test(dat$p,dat$type,location=c("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:  dat$p
## Test Statistic = 0.0014598, p-value = 0.9699

Answer (a):-

Hence by Levene’s test we get that p-value is 0.9699.

As the value of p is greater than 0.05, we state that we failed to reject the null hypothesis.

##Now as stated in problem 2.26 (b),that the mean burning times are equal, then by performing the t-test,

library (dplyr)
## 
## 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
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

Answer (b)

From the results of the t-test, we get that p-value is 0.9622

As the value of p is greater than 0.05, we state that we failed to reject the null hypothesis.