Measures of Central Tendency

Lab 2: Exploring Data

Dave Brocker

Farmingdale State College

Lab 3

Top 100 Billboard Hits

This week we are exploring the Billboard Hot 100 Number Ones Database. This workbook contains substantial data about every song to ever top the Billboard Hot 100 between August 4, 1958 and January 11, 2025. It was compiled by Chris Dalla Riva as he wrote the book Uncharted Territory: What Numbers Tell Us about the Biggest Hit Songs and Ourselves.

Data Tip #1

Look for Relevance!

This dataset has 105 columns (wow!) and they might not all be needed. Let’s focus on the ones that can be useful!

Billboard Dataset (Teaching Subset)
Columns, descriptions, and likely best measure of central tendency

Which Artist Has the Most Number 1’s?

Group Exercise

# Step 1: Read data
billboard <- 
  readr::read_csv(
    'https://raw.githubusercontent.com/rfordatascience/tidytuesday/main/data/2025/2025-08-26/billboard.csv',
    show_col_types = FALSE
  )

Which Artist Has the Most Number 1’s?

Group Exercise

# Step 1: Read data
billboard <- 
  readr::read_csv(
    'https://raw.githubusercontent.com/rfordatascience/tidytuesday/main/data/2025/2025-08-26/billboard.csv',
    show_col_types = FALSE
  )
# Step 2: Group by Artist
billboard |> 
  group_by(artist)

Which Artist Has the Most Number 1’s?

Group Exercise

# Step 1: Read data
billboard <- 
  readr::read_csv(
    'https://raw.githubusercontent.com/rfordatascience/tidytuesday/main/data/2025/2025-08-26/billboard.csv',
    show_col_types = FALSE
  )
# Step 2: Group by Artist
billboard |> 
  group_by(artist)
# Step 3: Count, ungroup, and select top 10
  count(sort = TRUE) |> 
  ungroup() |> 
  top_n(10)  

Which Artist Has the Most Number 1’s?

Group Exercise

artist Frequency
The Beatles
20
Mariah Carey
16
Madonna
12
Michael Jackson
11
Whitney Houston
11
Janet Jackson
10
Taylor Swift
10
The Supremes
10
Bee Gees
9
Stevie Wonder
8
The Rolling Stones
8

Lab 2 Questions

Answer 3 and Submit on Brightspace

  1. Which artist had the most number of weeks in the number on spot?
  2. Which artist is rated highest overall?
  3. What is the average rating of all the artists?
  4. What is the youngest age of the lead singer for a band?
  5. What is the median BPM?
  6. What is the percentage of explicit songs vs. non-explicit songs?
  7. What is the percentage of black vs. white artists?
  8. What is the percentage of male vs. female artists?

Lab 2 Question

Given the following dataset, find the mean:

\(\{1,3,5,4,3,2,1,4,5\}\)

00:42