promotion exercise
library(readxl)
Promotion <- read_excel("C:/Users/EOJVD/Desktop/data science classes/data science classes/Data Science Classes Yogesh/minitabplusrcodes/Promotion.xlsx")
## New names:
## * `` -> `..3`
View(Promotion)
x <- Promotion
attach(x)
Promotion <- x[,4:5]
colnames(Promotion)
## [1] "Interest Rate Waiver ($ spent)" "Standard Promotion ($ spent)"
colnames(Promotion)<-c("Iday","CHR")
View(Promotion)
attach(Promotion)
qqnorm(Iday)

shapiro.test(Iday)
##
## Shapiro-Wilk normality test
##
## data: Iday
## W = 0.99237, p-value = 0.2246
shapiro.test(CHR)
##
## Shapiro-Wilk normality test
##
## data: CHR
## W = 0.99198, p-value = 0.1916
var.test(Iday,CHR)
##
## F test to compare two variances
##
## data: Iday and CHR
## F = 1.0587, num df = 249, denom df = 249, p-value = 0.653
## alternative hypothesis: true ratio of variances is not equal to 1
## 95 percent confidence interval:
## 0.8253538 1.3580188
## sample estimates:
## ratio of variances
## 1.0587
t.test(Iday,CHR)
##
## Welch Two Sample t-test
##
## data: Iday and CHR
## t = 2.2604, df = 497.6, p-value = 0.02423
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## 9.301912 132.920168
## sample estimates:
## mean of x mean of y
## 1637.500 1566.389
t.test(Iday,CHR,alternative = "two.side",conf.level = 0.95, correct = TRUE)
##
## Welch Two Sample t-test
##
## data: Iday and CHR
## t = 2.2604, df = 497.6, p-value = 0.02423
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## 9.301912 132.920168
## sample estimates:
## mean of x mean of y
## 1637.500 1566.389
?t.test
## starting httpd help server ...
## done
t.test(Iday,CHR,alternative = "greater",var.equal = T)
##
## Two Sample t-test
##
## data: Iday and CHR
## t = 2.2604, df = 498, p-value = 0.01211
## alternative hypothesis: true difference in means is greater than 0
## 95 percent confidence interval:
## 19.26892 Inf
## sample estimates:
## mean of x mean of y
## 1637.500 1566.389