knitr::opts_chunk$set(echo = TRUE)
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)
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
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
##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