O'Reilly logo

Practical Predictive Analytics by Ralph Winters

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating matrix plots

If we want to explore tenure a bit further for the churners, we could also produce a matrix plot showing the association between tenure and any other variables we choose. In this example we will use the ggpairs() function to plot the matrix plots for tenure, gender, satisfaction, and monthly charges:

str(xchurn)install.packages("GGally")library(GGally)library(ggplot2)ggpairs(xchurn,c(3,4,7,8),lower=list(combo=wrap("facethist",binwidth=30)))

We can see from the plot that males churn quicker than females. This is indicated by the matrix plot in the first row and third column. Note that a boxplot is produced since a continuous variable (tenure) is being compared with a categorical variable (gender). The matrix plot is ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required