CommencerCommencer gratuitement

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.

Cet exercice fait partie du cours

Sampling in R

Afficher le cours

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Visualize the distribution of acousticness as a histogram with a binwidth of 0.01
___
Modifier et exécuter le code