Calmcode - smoking: smoking is bad

Smoking is Bad

1 2 3 4 5 6 7

When we normalise against age, suddenly we see another pattern.

(clean_df
  .assign(age=lambda d: np.round(d['age'] / 10) * 10)
  .groupby(['smokes', 'age'])
  .agg(p=('alive', np.mean))
  .reset_index()
  .pivot(index='age', columns='smokes', values='p')
  .plot())