Introduction

This report seeks to answer several questions related mainly to viewership and popularity of the US version of the hit TV show The Office. We will be exploring the relationships between the different episodes and seasons over time as well as how ratings and viewership changed with that.

We will be using a data set called office_ratings from https://raw.githubusercontent.com/. It contains all episodes and the season they aired, as well as viewership and IMDB rating data and original air date for each episode. There are a total of 7 variables to describe each episode. The season describes season it aired, the episode describes the episode number within the season, the title describes the name of the episode, viewers describes the number of viewers (in millions) on the original air date which is given by the variable air_date, and finally IMDB ratings are described by imdb_rating which gives the average fan rating from 1-10, and total_votes which gives the number of IMDB ratings for the episode. The full data set can be viewed below:

Throughout, we will need the functionality of the tidyverse package, mainly to create visualizations.

library(tidyverse)

Ratings and Viewership Numbers For Each Episode

The first thing we need to look for before we can start comparing more variables is trends or standouts in our viewership and IMDB related variables in relationship with each episode, since that is what we are describing. We can do this with box plots for each distribution:

ggplot(data = office_ratings) +
  geom_boxplot(mapping = aes(y = viewers)) +
  labs(y = "Number of Viewers (in Millions)",
       title = "Distribution of Viewers Variable")

The viewers distribution shows that there is one episode with millions more views than the rest of the episodes that are represented nicely in the fairly even, tight distribution demonstrated by the box. One single episode doubled the next highest episode’s viewership numbers causing an incredibly large skew in this variable. This happened because the episode aired on NBC directly after the broadcast of Super Bowl XLIII which highly inflated the number of viewers.

Looking next at the imdb_rating variable:

ggplot(data = office_ratings) +
  geom_boxplot(mapping = aes(y = imdb_rating)) +
  labs(y = "IMDB Rating",
       title = "Distribution of IMDB Rating Variable")

This variable shows a very even distribution, with only a couple outliers that are not that far out. We can see there were a couple episodes rated significantly lower than the average ~7-9.5 rating seen inside the distribution, and one episode rated significantly higher than the others in the distribution.

Finally, looking at the total_votes variable:

ggplot(data = office_ratings) +
  geom_boxplot(mapping = aes(y = total_votes)) +
  labs(y = "Number of Ratings on IMDB",
       title = "Distribution of Number of IMDB Ratings")

This distribution has several outliers that are much higher than the general distribution centered around 2000, with one of the outliers going up to 8000. I would hypothesize these to be fan-favorites or season finale episodes.

Viewership and Ratings Relationship

Now, looking at some variable relationships to understand these data further, we will look at the relationship between number of viewers and IMDB rating. I hypothesize there will be a positive correlation between the two. We can visualize this with a scatter plot:

ggplot(data = office_ratings, mapping = aes(x = viewers, y = imdb_rating)) +
  geom_point() +
  geom_smooth(se = FALSE) +
  labs(x = "Number of Views (In Millions)",
       y = "IMDB Rating",
       title = "IMDB Rating as a Function of Number of Viewers")

This scatter plot does show a slight positive correlation even with the large variation, confirming our hypothesis. However, we can see that there are some exceptions which can be better understood by adding color to distinguish what season each episode is from.

ggplot(data = office_ratings) +
  geom_point(mapping = aes(x = viewers, y = imdb_rating, color = season)) +
  geom_smooth(mapping = aes(x = viewers, y = imdb_rating), se = FALSE) +
  labs(x = "Number of Views (In Millions)",
       y = "IMDB Rating",
       title = "IMDB Rating as a Function of Number of Viewers",
       color = "Season")

This visualization makes it easy to see that there is one episode above 10 million viewers (farther right than most of the points) with a fairly low rating, below 8. We can see that this episode is from season 1, which is widely regarded by fans of The Office as one of the worse seasons. I would hypothesize this point is likely the pilot episode which would explain the high viewership for the one episode out of the season.

Now, we will investigate if the number of viewers of an episode effects the number of IMDB reviews left for an episode. I would hypothesize this to also indicate a positive correlation, which we can again test with a scatter plot:

ggplot(data = office_ratings, mapping = aes(x = viewers, y = total_votes)) +
  geom_smooth(se = FALSE) +
  geom_point() +
  labs(title = "Total IMDb Ratings as a Function of Number of Views",
       x = "Viewers (Millions)",
       y = "Total IMDb Ratings")

Though these data are again skewed, they do seem to support our hypothesis that more viewers results in more ratings on IMDB. Again, we do see a very obvious outlier that has viewership on the lower end but a very high number of rankings. We can try to explain this again by color coding by season:

ggplot(data = office_ratings) +
  geom_smooth(mapping = aes(x = viewers, y = total_votes), se = FALSE) +
  geom_point(mapping = aes(x = viewers, y = total_votes, color = season)) +
  labs(title = "Total IMDb Ratings as a Function of Number of Views",
       x = "Viewers (Millions)",
       y = "Total IMDb Ratings",
       color = "Season")

We can see that the aforementioned point is from season 9, leading me to believe this may have been the finale of the show. Viewership was much lower by season 9 due to the steady decrease in viewership after Micheal, Steve Carrell’s character, leaves the show at the end of season 7.

Popularity Analysis of The Office

First, we can look at the popularity of the show over time. We can do this by analyzing the relationship of number of viewers (indication of popularity) and air dates of the episodes with a line graph:

ggplot(data = office_ratings) +
  geom_line(mapping = aes(x = air_date, y = viewers, group =1)) +
  labs(x = "Air Date",
       y = "Number of Viewers (In Millions",
       title = "Popularity of The Office Over Time")

We can observe that The Office had a steep decline in popularity after the pilot, but steadily rose over the next few years. We see a sharp increase in viewership around 2009 that we also saw skewing our data in earlier plots, but we know this was likely a fan favorite and an outlier we can ignore. We then see a decline in popularity after 2011. I would assume this is likely when the seasons without Steve Carrell were airing, as these were not as popular among fans without his beloved character Micheal.

Next, we can assess the appeal over time by examining the relationship between IMDB ratings in relationship to the air date.

ggplot(data = office_ratings) +
  geom_line(mapping = aes(x = air_date, y = imdb_rating, group = 1)) +
  labs(x = "Air Date",
       y = "IMDB Rating",
       title = "Appeal of The Office Over Time")

We can see from this graph, that the middle seasons of The Office were much better received overall than the first season or the last couple seasons. Again, I believe this is related to the first season being not well received by fans, as well as the last couple of seasons missing Steve Carrell’s beloved character Micheal.

Though popularity and appeal have a similar trend, they are not quite the same. Popularity seems to vary a lot more and be a much more rapidly changing variable than appeal, which stays somewhat more steady. This can be visualized by the last two plots.

Conclusion

There are a couple of recurring themes we see jump out from this data that we can conclude. First, the first season as well as the last two seasons of The Office were not nearly as popular or well received as the others. We can also conclude, that as hypothesized, higher number of views for an episode correlates with higher ratings and number of ratings left for that episode on IMDB. We can also conclude that overall, the trend for popularity and appeal was similar. This trend is the increase after season 1, and the drop after season 7. Though we saw each season had its highs and lows, especially a high in season 5, the show was very consistently watched until the end, especially season 9.