title: “Impact of In-Store Promotions on Sales of Pepsi” author: “Om Joy Halder” date: “19 September 2017” output: html_document
store.df <- read.csv(paste("StoreData.csv", sep=""))
View(store.df)
summary(store.df$p2sales)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 51.0 84.0 96.0 100.2 113.0 225.0
boxplot(store.df$p2sales)
attach(store.df)
boxplot(p2sales,data=store.df,main="Box Plot",ylab="sales Unit")
## table aggregating the sales of Product 2 (Pepsi) in1 the presence / absence of promotions.
aggregate(store.df$p2sales, by=list(promotion=store.df$p2prom),sum)
## promotion x
## 1 0 169659
## 2 1 38667
store.df$p2prom.f <- factor(store.df$p2prom,
levels=c(0,1),
labels=c("No promotion","Promotion"))
library(gplots)
##
## Attaching package: 'gplots'
## The following object is masked from 'package:stats':
##
## lowess
# Plot the mean of teeth length by dose groups
plotmeans(store.df$p2sales ~ store.df$p2prom.f, data = store.df, frame = FALSE)
## Warning in arrows(x, li, x, pmax(y - gap, li), col = barcol, lwd = lwd, :
## zero-length arrow is of indeterminate angle and so skipped
## Warning in arrows(x, ui, x, pmin(y + gap, ui), col = barcol, lwd = lwd, :
## zero-length arrow is of indeterminate angle and so skipped
## Warning in plot.xy(xy.coords(x, y), type = type, ...): "frame" is not a
## graphical parameter
## Warning in axis(1, at = 1:length(means), labels = legends, ...): "frame" is
## not a graphical parameter
## Warning in plot.xy(xy.coords(x, y), type = type, ...): "frame" is not a
## graphical parameter