a<-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")
q<-as.factor(type)
dat<-data.frame(a,type)
from the above boxplot we can see that the variances are equal, Hence we need to run the levene’s test # Running Levene’s Test
library(lawstat)
levene.test(dat$a,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$a
## Test Statistic = 0.0014598, p-value = 0.9699
The value of P=0.9699 which is greater than 0.05 hence we failed to reject the null hypothesis # Running T.test
##
## Two Sample t-test
##
## data: type1 and type2
## t = 0.048008, df = 18, p-value = 0.5189
## alternative hypothesis: true difference in means is less than 0
## 95 percent confidence interval:
## -Inf 7.424109
## sample estimates:
## mean of x mean of y
## 70.4 70.2
The value of P=0.51 which is greater than 0.05 hence we failed to reject the null hypothesis