Data analysis

Let's take a deeper look at the data. In this section, we are going to focus on understanding the distributions of sales, market sizes, store locations, and store ages used to test different promotions. The goal of this analysis is to make sure that the controls and attributes of each promotion groups are symmetrically distributed, so that the promotion performances among different groups are comparable to each other.

The total sales distributions across different promotions can be visualized using the following code:

salesPerPromo <- df %>%   group_by(Promotion) %>%  summarise(Sales=sum(SalesInThousands))ggplot(salesPerPromo, aes(x="", y=Sales, fill=Promotion)) +  geom_bar(width=1, stat = "identity", position=position_fill()) ...

Get Hands-On Data Science for Marketing now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.