Learn

In this lesson we discussed several ways of examining an association between two quantitative variables. More specifically, we:

  • Used scatter plots to examine relationships between quantitative variables
  • Used covariance and correlation to quantify the strength of a linear relationship between two quantitative variables

Note that the dataset used in this lesson was downloaded from kaggle.

Instructions

As a final exercise, a new dataset named penguins has been uploaded for you in script.py. This dataset contains various measurements for a sample of penguins. To practice the skills learned in this lesson, here are some things to try:

  • Inspect the first few rows of data.
  • Create a scatter plot of flipper length (flipper_length_mm) and body mass (body_mass_g).
  • Inspect your plot. What is the relationship between these variables?
  • Calculate the covariance for these two variables.
  • Calculate the correlation for these two variables. Does this number make sense given the plot you created?

Solution code is available to you in solution.py if you want to compare your work.

Sign up to start coding

By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.
Already have an account?