It seems that age indeed matters.
(clean_df
.assign(r=1)
.assign(age=lambda d: np.round(d['age'] / 5) * 5)
.groupby(['age'])
.agg(p_alive=('alive', np.mean),
p_smokes=('smokes', np.mean))
.plot());
smoking: what about age
It seems that age indeed matters.
(clean_df
.assign(r=1)
.assign(age=lambda d: np.round(d['age'] / 5) * 5)
.groupby(['age'])
.agg(p_alive=('alive', np.mean),
p_smokes=('smokes', np.mean))
.plot());