Session Ready
Exercise

Jittering

In the previous exercise, the ages fall in columns because they've been rounded into 5-year bins. If we jitter them, the scatter plot will show the relationship more clearly. Recall how Allen jittered height and weight in the video:

height_jitter = height + np.random.normal(0, 2, size=len(brfss))
weight_jitter = weight + np.random.normal(0, 2, size=len(brfss))
Instructions
100 XP
  • Add random noise to age with mean 0 and standard deviation 2.5.
  • Make a scatter plot between weight and age with marker size 5 and alpha=0.2. Be sure to also specify 'o'.