
Understanding customer churn on Tableau can provide banks valuable information on who are leaving the banks. Data visualization can help the banks to plan out their next marketing campaign such as which age groups to target. The banks in our study are located in Spain, France, and Germany. Please see the below document.
The file name is inspired by Child's Play movies.
Using the Chi-Squared Test from my categorical data class, we can find out whether the two categorical variables that we are interested are independent or dependent. We are going to test the dependency of Gender and Exited variables in R. The null hypothesis: whether gender is independent of the choice of exiting. Similarly, we are going to test the dependency of Geography and Exited variables in R. The null hypothesis: whether country is independent of the choice of exiting.
# Load up the dataset
dataset = read.csv('Churn-Modeling.csv')
# Chi-Squared Test of Independence
library(MASS)
# Gender and Exited/Stayed
gen = table(dataset$Gender, dataset$Exited)
chisq.test(gen)

The above result is the Pearson's Chi-squared test. Here we have a very small p-value and this indicates that gender is dependent of the choice of exiting.
# Country and Exited/Stayed
geo = table(dataset$Geography, dataset$Exited)
chisq.test(geo)

Here we have a very small p-value again and this indicates that geographical location is dependent of the choice of exiting.
No comments:
Post a Comment