March 2019
Beginner to intermediate
464 pages
10h 57m
English
Next, we will try to see whether there are any differences in the distributions of the bank balances between the conversion and non-conversion groups. A box plot is typically a good way to visualize the distribution of a variable. Let's take a look at the following code:
ggplot(df, aes(x="", y=balance)) + geom_boxplot() + facet_wrap(~conversion) + ylab("balance") + xlab("0: Non-Conversion, 1: Conversion") + ggtitle("Conversion vs. Non-Conversions: Balance") + theme(plot.title=element_text(hjust=0.5))
You should be familiar with this code by now, as we discussed how to build box plots in the previous chapter, using the ggplot and geom_boxplot functions. When you run this code, you will see the following box plot: ...
Read now
Unlock full access