Analysis of Social Drinkers and Smokers
Let's begin with an analysis of the impact of being a drinker or smoker on employee absenteeism. As smoking and frequent drinking have a negative impact on health conditions, we would expect that certain diseases are more frequent in smokers and drinkers than others. Note that in the absenteeism dataset, 56% of the registered employees are drinkers, while only 7% are smokers. We can produce a figure, similar to Figure 2.6 for the social drinkers and smokers with the following code:
# plot reasons for absence against being a social drinker/smoker plt.figure(figsize=(8, 6)) sns.countplot(data=preprocessed_data, x="Reason for absence", \ Â Â Â Â Â Â Â Â Â Â Â Â Â Â hue="Social drinker", hue_order=["Yes", "No"]) plt.savefig('figs/absence_reasons_drinkers.png', \ Â Â Â Â Â Â Â Â Â Â Â Â format...