Introduction to Quantifying “The Office”

“The Office” is a popular American TV comedy following a group of salesman at a paper company. It is the goal of this project to use graphing in R to understand the relationship between the number of initial viewers, the number of online reviews submitted to IMDB, the average score of those reviews, and the progression of the series. This will be done using data from the IMDB website in the form of a data set which will be displayed below. The important variables in this data set will be: viewers, the viewers in millionswhich is in millions; imdb_rating, the average rating of an episode on IMDB; total_votes, the number of reviews, episode; and season. This data is for the date of release for each episode, not the cumulative number of each variable.

office_ratings <- readr::read_csv('https://raw.githubusercontent.com/jafox11/MS282/main/office_ratings.csv')
office_ratings$season <- as.character(office_ratings$season)
office_ratings$air_date <- as.Date(office_ratings$air_date, "%m/%d/%Y")
library(tidyverse)
library(DT)

The prior code chunks first introduced our data set to R to manipulate and added the libraries with the tools we want to use respectively. Here is the data set that was just imported:

datatable(office_ratings, options = list(scrollx = TRUE))

Graphical Analysis

General Viewership and Rating Relation

ggplot(data = office_ratings) +
  geom_point(mapping = aes(x = viewers, y = total_votes, color = imdb_rating)) +
  labs(title = "IMDB Ratings of Office Episode Compared to Viewership",
       x = "Viewers (In Millions)",
       y = "Number of Rating Submissions",
       color = "Rating _/10")

ggplot(data = office_ratings) +
  geom_smooth(mapping = aes(x = viewers, y = total_votes), se = FALSE) +
  geom_point(mapping = aes(x = viewers, y = total_votes)) +
  labs(title = "Correlation of Rating Qauntity vs. Viewership in 'The Office'",
       x = "Viewers(In Millions)",
       y = "Ratings Submitted")

A relationship can be established using the graphs above to relate viewership to rating quantity and rating quantity to rating quality. Generally, as viewership increases so does rating quantity, and as rating quantity increases so does rating quality. There are observations that do not follow this trend. One hypothesis for this is that these points are season finales and thus are viewed significantly more favorably than other episodes.

ggplot(data = office_ratings) +
  geom_point(mapping = aes(x = episode, y = total_votes, color = imdb_rating)) +
  facet_grid(rows = vars(season)) +
  labs(title = "Episode Rating Trend in Each Season of 'The Office'",
       x = "Episode",
       y = "Number of Ratings",
       color = "Rating _/10")

While it is clear the hypothesis is not always the case, it does explain some observations from earlier. In general, the last episode of a season has more reviews submitted and a higher rating than the others in that season. This does not explain every outlier, however. Unfortunately given the limited data available it is only possible to theorize why this may be the case.

Concluding Remarks

Just as “The Office” ended, so too must the analysis of the data gathered from it. The graphical analysis of Viewership, Rating Quantity, and Rating Quality as the show revealed many relationships that would have been hard to characterize otherwise. First, it is generally true that as an episode receives more viewers so too does it get more ratings. Then, the trend is shown that as an episode receives more ratings the rating quality also improves. Thus it can be said that in general as viewership increases so too does the rating of an episode. With this, however, there also exists the fact that at and past season four the appeal of the episodes starts inconsistently decline, which is likely the cause of the declining viewership. There is no data for 12.5-22.5 million viewers, so extrapolating whether the trends observed would continue over this range is difficult. There is only so much that data can show, there are also qualitative aspects of the show not considered in this analysis.