Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Figure 5.3 shows interaction model instead of main effect model #62

Open
MMJansen opened this issue Oct 8, 2022 · 0 comments
Open

Figure 5.3 shows interaction model instead of main effect model #62

MMJansen opened this issue Oct 8, 2022 · 0 comments

Comments

@MMJansen
Copy link

MMJansen commented Oct 8, 2022

Version of the book 2020-02-01

Regarding fig 5.3 (Predicted probability of attrition based on monthly income and whether or not employees work overtime)

Model 3 is a main effect model. The model lines in figure 5.3 are made using geom_smooth(). This results in lines in which the interaction effect is also taken into account. A better way to illustrate the model with only main effects, could be just to plot the predictions from the model. I did this with modelr::add_predictions() :
churn_train3 <- modelr::add_predictions(churn_train, model = model3, type = "response") %>% mutate(prob = ifelse(Attrition == "Yes", 1, 0))

@MMJansen MMJansen changed the title Figure 5.3 Shows interaction model (Predicted probability of attrition based on monthly income and whether or not employees work overtime) Figure 5.3 shows interaction model instead of main effect model Oct 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant