Like a few million other people, I spent the weekend of Oct. 27, 2017, watching Stranger Things 2, and the following week dealing with minor withdrawal.

To cope, and to transition back into my research, I decided to apply the statistical paddles of sentiment analysis and network analysis to the scripts from Seasons 1 and 2, and to consider what the results might say about the emotional structure of each episode of the show.

To begin understanding the emotion of Stranger Things, I downloaded the scripts and assigned a numeric value to each word based on its positive or negative valence. The simplest aspect of emotion to look at is the average valence of each episode. This metric is obtained by taking the mean sentiment value of all words in an episode, regardless of the order in which they are spoken.

These values are generally what you might expect from a show about missing children and inter-dimensional monsters, with most episodes showing more negative than positive emotion.

The most interesting finding seems to be the degree to which the less-than-well-received Chicago episode — number 15 — stands out as being more than twice as negative as any other. This may be due to a combination of its dark plot and the lack of any comedic relief from the Hawkins gang.

However, there is a lot of temporal information missing from those averages, so let’s take a look at how the emotional tone changes over time within episodes.

One way to do this is to use the sliding window technique. For this version of a sliding window, we’re going to take the average of the 40 words surrounding a central word, then continually shift one word over and take a new average. This yields a smooth trajectory of the emotional valence over the course of each episode.

While it’s difficult to learn much from simply looking at the trajectories, a few things do pop out.

First, with only one exception (you guessed it, the Chicago episode), even the darkest episodes typically have a few scenes that are heavy on positive sentiment.

Second, of the 17 episodes, only three end on a high note: the Season 1 finale, the Season 2 premiere, and the Season 2 finale.

Third, there is a lot of variation in how these episodes are structured, and they don’t seem to follow a clear emotional pattern. Let’s roll with that last point and see if we can characterize some of that variation.

As a baseline for comparison, we can check whether the season in which an episode appears contains enough information to explain similarities and differences across emotional trajectories.

Unsurprisingly, it does not (p = .34) . In general, both Season 1 and Season 2 have a great deal of variability in their episodes’ structures. The average trajectories both tend to hover around neutral.

To find a better classification, let’s first conceptualize the relationships between episodes as a network by calculating the temporal correlation for every pair of episodes. In this context, the nodes are episodes and the edges represent the degree to which pairs show similar patterns of emotion.

Once this network is constructed, we can apply methods borrowed from graph theory to find communities in our data. In this case, three distinct episode groups are revealed, and the within-group similarity is greater than would be expected to occur by chance (p < .001) .

Now that we’ve found our communities of interest, let’s map them back onto the emotion trajectories to see if they capture any more of the variability.

Unlike the division by season, these average group trajectories appear to describe three distinct patterns. They also seem to track fairly well onto their underlying episode trajectories.

Looking at the average patterns, we can see that group 1 contains episodes that begin and end with neutral emotion and have slow fluctuations in the middle, group 2 contains episodes that begin with negative emotion and gradually climb towards a positive ending, and group 3 contains episodes that begin on a positive note and oscillate downwards towards a darker ending.

In addition to plotting the communities of emotion patterns, let’s take a look at the full network structure.

The first thing that jumps out is that each group contains an approximately equal number of episodes from Season 1 and Season 2. This supports the earlier finding that season is not a good predictor of episode similarity. We can also see that episode 15 again stands out from the rest. This time because it is more loosely connected to the rest of the graph than any of the other episodes.

Perhaps most interestingly, the network reveals that episodes tend to be less like those preceding and proceeding them than you would expect to occur by chance (p = .03) . Additionally, the transitions from episodes 1→2, 2→3, and 3→4 have three of the five largest shifts in emotional structure of the 16 transitions that occurred in the show.

Together, these results suggest that varying the emotional trajectory from episode to episode may be a strategy for getting viewers hooked.

Will future episodes continue to show these changes in emotional structure? Will they follow the same three dominant emotional trajectories? Will future attempts at creating boldly different episodes land better than Chicago? Chalk those up as more unanswered questions for Season 3.