March 2019
Beginner to intermediate
464 pages
10h 57m
English
The last thing that we are going to look at before we dive into the regression analysis is are the differences in the distributions of Total Claim Amount between the engaged and non-engaged groups. We are going to visualize this by using box plots. Let's first look at how we can build box plots in R:
ggplot(df, aes(x="", y=Total.Claim.Amount)) + geom_boxplot() + facet_wrap(~Engaged) + ylab("Total Claim Amount") + xlab("0: Not Engaged, 1: Engaged") + ggtitle("Engaged vs. Not Engaged: Total Claim Amount") + theme(plot.title=element_text(hjust=0.5))
As you can see in this code, it is quite straightforward to build box plots in R. You can simply call the ggplot function with geom_boxplot. A box plot is a great way to visualize ...
Read now
Unlock full access