1. Learn
  2. /
  3. Courses
  4. /
  5. Sampling in R

Exercise

Are findings from the sample generalizable?

You just saw how convenience sampling—collecting data via the easiest method can result in samples that aren't representative of the whole population. Equivalently, this means findings from the sample are not generalizable to the whole population. Visualizing the distributions of the population and the sample can help determine whether or not the sample is representative of the population.

The Spotify dataset contains a column named acousticness, which is a confidence measure from zero to one of whether the track is acoustic, that is, it was made with instruments that aren't plugged in. Here, you'll look at acousticness in the total population of songs, and in a sample of those songs.

spotify_population and spotify_mysterious_sample are available; dplyr and ggplot2 are loaded.

Instructions 1/3

undefined XP
    1
    2
    3
  • Using spotify_population, draw a histogram of acousticness with binwidth of 0.01.