knitr::opts_chunk$set(message = FALSE, warning = FALSE)
if (.Platform$OS.type == "windows") {
Sys.setlocale("LC_CTYPE", ".UTF-8")
}
## [1] "English_United States.utf8"
library(tidyverse)
library(magrittr)
library(tidytext)
library(httr2)
library(lubridate)
library(kableExtra)
sentiment_colors <- c(negative = "#dc6666", neutral = "#7b8794", positive = "#3aae90")
period_colors <- c("Before launch" = "#6289a8", "After launch" = "#e3a33b")
Research question
On January 5, 2025, New York City became the first U.S. city to charge drivers a toll to enter its busiest district (Manhattan below 60th Street). The policy was argued over for years before it started, and early reports after launch said traffic had dropped. This report asks:
How did YouTube viewers respond to NYC congestion pricing before and after it launched? Did their comments become less negative once the toll was in place, and which concerns (cost to drivers, traffic, transit, politics, fairness) drove the negative and positive reactions?
Videos
I compare comments on two long-form explainer videos about the same policy, one released before launch and one after:
| Period | Video | Channel | Link |
|---|---|---|---|
| Before launch | The Battle Over NYC Congestion Pricing | Wendover Productions | https://www.youtube.com/watch?v=B2j-LgcA7Gk |
| After launch | New York Declares War On Traffic (A Congestion Pricing Story) | Climate Town | https://www.youtube.com/watch?v=DEFBn0r53uQ |
Both videos explain the same plan in depth and attracted large comment sections, so their comments capture people arguing about the policy itself rather than reacting to a short news clip. The Wendover video was posted while the start date was still uncertain, so its comments show expectations and objections before anyone had paid the toll. The Climate Town video was posted about three months after launch and discusses early results, so its comments show reactions once the policy was real. Comparing the two lets me see whether tone and topics shifted after launch.
The comparison has limits. The two channels have different audiences and styles (Climate Town is openly pro-transit comedy, Wendover is a neutral explainer), so a difference in tone may reflect the audience as much as the timing. I keep this in mind when interpreting results.
Collecting and preparing the comments
Check the videos and collect comments
Before collecting, I checked each video’s title, publish date and
comment count with the YouTube Data API videos endpoint to
confirm there are enough comments. I then collected up to 1,500
top-level comments per video with the
get_youtube_comments() function from the lab, using
order = "relevance". This chunk is not run when knitting;
the report loads the saved files instead.
api_key <- Sys.getenv("google_api") # key kept in .Renviron, never typed here
videos <- tibble(
video_id = c("B2j-LgcA7Gk", "DEFBn0r53uQ"),
period = c("Before launch", "After launch")
)
# 1. Confirm titles, dates and comment counts before committing to the question
video_check <- request("https://www.googleapis.com/youtube/v3/videos") %>%
req_url_query(part = "snippet,statistics",
id = str_c(videos$video_id, collapse = ","),
key = api_key) %>%
req_perform() %>%
resp_body_json()
video_info <- map_dfr(video_check$items, function(item) {
tibble(video_id = item$id,
title = item$snippet$title,
channel = item$snippet$channelTitle,
published_at = item$snippet$publishedAt,
view_count = as.numeric(item$statistics$viewCount),
comment_count = as.numeric(item$statistics$commentCount))
}) %>%
left_join(videos, by = "video_id")
write_csv(video_info, "video_info.csv")
# 2. Collect top-level comments (function from the YouTube comments lab)
get_youtube_comments <- function(video_id, api_key, max_comments = 1000) {
comments <- tibble()
page_token <- NULL
while (nrow(comments) < max_comments) {
api_request <- request("https://www.googleapis.com/youtube/v3/commentThreads") %>%
req_url_query(
part = "snippet",
videoId = video_id,
maxResults = min(100, max_comments - nrow(comments)),
order = "relevance",
textFormat = "plainText",
key = api_key
)
if (!is.null(page_token)) {
api_request %<>% req_url_query(pageToken = page_token)
}
body <- api_request %>% req_perform() %>% resp_body_json()
page <- map_dfr(body$items, function(item) {
comment <- item$snippet$topLevelComment
snippet <- comment$snippet
tibble(
video_id = video_id,
comment_id = comment$id,
text = snippet$textDisplay,
published_at = snippet$publishedAt,
like_count = snippet$likeCount,
reply_count = item$snippet$totalReplyCount
)
})
comments <- bind_rows(comments, page) %>%
distinct(comment_id, .keep_all = TRUE)
page_token <- body$nextPageToken
if (is.null(page_token) || nrow(page) == 0) break
}
comments %>% slice_head(n = max_comments)
}
youtube_comments <- map_dfr(videos$video_id, get_youtube_comments,
api_key = api_key, max_comments = 1500)
write_csv(youtube_comments, "youtube_comments.csv") # this file is uploaded to Colab
Load the saved data
video_info <- read_csv("video_info.csv", show_col_types = F,
col_types = cols(video_id = col_character()))
youtube_comments <- read_csv("youtube_comments.csv", show_col_types = F,
col_types = cols(comment_id = col_character(),
video_id = col_character(),
published_at = col_character()))
stopifnot(!anyNA(youtube_comments$comment_id),
!anyDuplicated(youtube_comments$comment_id))
video_info %>%
mutate(published = as_date(ymd_hms(published_at))) %>%
select(period, channel, title, published, view_count, comment_count) %>%
knitr::kable(format = "html", escape = T, format.args = list(big.mark = ","),
col.names = c("Period", "Channel", "Title", "Published",
"Views", "Comments shown on YouTube"))
| Period | Channel | Title | Published | Views | Comments shown on YouTube |
|---|---|---|---|---|---|
| Before launch | Wendover Productions | The Battle Over NYC Congestion Pricing | 2024-12-17 | 1,430,139 | 4,606 |
| After launch | Climate Town | New York Declares War On Traffic (A Congestion Pricing Story) | 2025-04-03 | 769,646 | 2,782 |
The comment counts shown on YouTube include replies, so they are
larger than the number of top-level comments the API can return. With
order = "relevance", the API also stopped returning new
pages before reaching 1,500 comments for each video, so the collected
counts below are what the API made available in that ordering.
Filtering and text preparation
I keep the original text for sentiment prediction and
for quoting comments. For word-based analyses I make a separate
text_clean column with links removed and whitespace
squished. I exclude comments that contain no letters at all (emoji-only
or timestamp-only comments), because neither the model nor the word
analyses can interpret them.
collected <- youtube_comments %>%
left_join(select(video_info, video_id, period), by = "video_id")
youtube_comments <- collected %>%
mutate(text_clean = text %>%
str_remove_all("https?://\\S+") %>%
str_squish(),
period = factor(period, levels = c("Before launch", "After launch"))) %>%
filter(str_detect(text_clean, "[A-Za-z]"))
# Comments collected and kept for each video
collected %>%
count(period, name = "collected") %>%
left_join(count(youtube_comments, period, name = "kept"),
by = "period") %>%
mutate(excluded = collected - kept,
period = factor(period, levels = c("Before launch", "After launch"))) %>%
arrange(period) %>%
knitr::kable(format = "html", escape = T,
col.names = c("Period", "Top-level comments collected",
"Kept for analysis", "Excluded (no letters)"))
| Period | Top-level comments collected | Kept for analysis | Excluded (no letters) |
|---|---|---|---|
| Before launch | 917 | 915 | 2 |
| After launch | 1029 | 1022 | 7 |
Deep-learning sentiment
Import the predictions
I uploaded youtube_comments.csv (with
comment_id and the original text) to the
course Colab notebook, which applies Cardiff NLP’s Twitter-RoBERTa
sentiment model, and downloaded
youtube_comments_sentiment.csv. The model labels each
comment negative, neutral or positive; sentiment_score is
its confidence in that label, not the strength of the sentiment.
transformer_results <- read_csv("youtube_comments_sentiment.csv", show_col_types = F,
col_types = cols(comment_id = col_character())) %>%
select(comment_id, sentiment_label, sentiment_score,
negative_score, neutral_score, positive_score, text_truncated)
youtube_sentiment <- youtube_comments %>%
inner_join(transformer_results, by = "comment_id") %>%
mutate(sentiment_label = factor(sentiment_label,
levels = c("negative", "neutral", "positive")))
# Every kept comment should have a prediction
stopifnot(nrow(youtube_sentiment) == nrow(youtube_comments))
sum(youtube_sentiment$text_truncated)
## [1] 5
Sentiment before and after launch
period_sentiment <- youtube_sentiment %>%
count(period, sentiment_label, name = "comments") %>%
group_by(period) %>%
mutate(proportion = comments / sum(comments)) %>%
ungroup()
period_sentiment %>%
select(-comments) %>%
pivot_wider(names_from = sentiment_label, values_from = proportion) %>%
left_join(count(youtube_sentiment, period, name = "comments"), by = "period") %>%
relocate(comments, .after = period) %>%
knitr::kable(format = "html", escape = T, digits = 3,
col.names = c("Period", "Comments", "Negative", "Neutral", "Positive"))
| Period | Comments | Negative | Neutral | Positive |
|---|---|---|---|---|
| Before launch | 915 | 0.584 | 0.311 | 0.105 |
| After launch | 1022 | 0.386 | 0.277 | 0.338 |
period_sentiment %>%
ggplot(aes(period, proportion, fill = sentiment_label)) +
geom_col() +
scale_fill_manual(values = sentiment_colors) +
scale_y_continuous(labels = scales::percent) +
labs(x = NULL, y = "Share of comments", fill = "Predicted sentiment") +
theme_bw()
How credible are the predictions?
Neither the model nor any dictionary is ground truth, so I read a random sample of comments from each predicted label in each period. I also check how many predictions the model makes with low confidence, since those are the most likely to be wrong or ambiguous.
set.seed(1234)
youtube_sentiment %>%
group_by(period, sentiment_label) %>%
slice_sample(n = 3) %>%
ungroup() %>%
select(period, sentiment_label, sentiment_score, text) %>%
knitr::kable(format = "html", escape = T, digits = 3,
col.names = c("Period", "Predicted", "Confidence", "Comment"))
| Period | Predicted | Confidence | Comment |
|---|---|---|---|
| Before launch | negative | 0.694 | why dont they invest the money into NEW subway lines? |
| Before launch | negative | 0.885 | We effectively have congestion pricing in the Bay Area with all the different tolls they keep implementing, and it is absolutely a tax on the people who commute to San Francisco to work. Meaning, it targets low income service workers driving in for work and not the people who can afford to live in the city. It’s a garbage idea for this area and it sounds like that’s the case for NYC as well. |
| Before launch | negative | 0.740 | The key takeaway from this video should be to just avoid NYC. |
| Before launch | neutral | 0.840 | congestion pricing depending on income. 100usd if you own a certain amount, etc |
| Before launch | neutral | 0.592 | Turn three central avenues into moving walkways! |
| Before launch | neutral | 0.464 | The elitist argument is the most accurate. |
| Before launch | positive | 0.729 | Congestion pricing will absolutely benefit New York, as it has in every other city it has been implemented. Car drivers are major beneficiaries of public transport - far more people take the train than drive in New York, imagine how bad traffic would be if they all drove. It’s only fair that car drivers pay for this service. |
| Before launch | positive | 0.863 | Interesting content, but you should’ve had a native New Yorker review your stock images and vid clips for contextual accuracy. Nevertheless, keep up the good work. |
| Before launch | positive | 0.932 | sam is great |
| After launch | negative | 0.917 |
You do a lot of complaining instead of getting to the reason why I clicked on the video. Real fucking neat that cars are toxic, what does it have to do with toll roads? |
| After launch | negative | 0.811 | starts at 9 dollars 2 years later 15 dollars 5 years 25 dollars and 10 years 100 dollars congestion pricing is theft to fund system that dosnt work if public transport is soo wonderfull why not just charge what that costs oh wait yeah becuse no one wants to use it |
| After launch | negative | 0.904 | Such a biased page. As if we’re not charged enough taxes and fees in this country. Maybe your party should have done something to help New York with all the money that they gave away to bullshit. Then you wouldn’t have to keep holding your hands out to citizens |
| After launch | neutral | 0.609 | No car, no worries. I ride the subway. |
| After launch | neutral | 0.946 | 26:05–was…was that Aziz “Hax$” that you witnessed jumping on the tracks, late 2024? |
| After launch | neutral | 0.684 | 9:51 that guy with the indecipherable accent and the person responding “Hmm?!” LOL |
| After launch | positive | 0.964 | I just visited NYC for the first time a few weeks ago. I thought the subway was great! dirty, but super efficient. I’m also studying the congestion pricing in my master program rn - it was cool to got o NYC and see it implemented. I live in San Diego, which is great, but if you even mention de-prioritizing cars, people’s (mostly oldies) heads literally explode. ’BuT wHeRe WiLl wE PaRk?!?!” and then they bitch about traffic. it’s insane. |
| After launch | positive | 0.972 | You guys pack so much entertainment and information into one video it’s insane! |
| After launch | positive | 0.656 | Also it’s probably cool that they waited until bond rates and prices were way higher to do this MTA bond program |
# Predictions where the model's top label has less than 60% probability
youtube_sentiment %>%
group_by(period) %>%
summarize(comments = n(),
low_confidence = sum(sentiment_score < 0.6),
share_low_confidence = mean(sentiment_score < 0.6),
.groups = "drop") %>%
knitr::kable(format = "html", escape = T, digits = 3,
col.names = c("Period", "Comments", "Low-confidence (< 0.6)",
"Share low-confidence"))
| Period | Comments | Low-confidence (< 0.6) | Share low-confidence |
|---|---|---|---|
| Before launch | 915 | 212 | 0.232 |
| After launch | 1022 | 243 | 0.238 |
# Does the before/after difference hold if the low-confidence predictions are dropped?
youtube_sentiment %>%
filter(sentiment_score >= 0.6) %>%
count(period, sentiment_label) %>%
group_by(period) %>%
mutate(proportion = n / sum(n)) %>%
select(-n) %>%
pivot_wider(names_from = sentiment_label, values_from = proportion) %>%
knitr::kable(format = "html", escape = T, digits = 3,
col.names = c("Period", "Negative", "Neutral", "Positive"))
| Period | Negative | Neutral | Positive |
|---|---|---|---|
| Before launch | 0.646 | 0.246 | 0.108 |
| After launch | 0.403 | 0.214 | 0.383 |
# Examples of the least confident predictions
youtube_sentiment %>%
slice_min(sentiment_score, n = 6, with_ties = F) %>%
select(period, sentiment_label, sentiment_score, text) %>%
knitr::kable(format = "html", escape = T, digits = 3,
col.names = c("Period", "Predicted", "Confidence", "Comment"))
| Period | Predicted | Confidence | Comment |
|---|---|---|---|
| After launch | positive | 0.352 | Hello from Sweden. I live in Stockholm and the congestion pricing is really good! But even here in Stockholm there is so much more to be done. The thing I personally hate the most with traffic is noise pollution. Air pollution is of course bad and it kills people but the noise from cars cannot be ignored, you need to have noise-cancelling headphones or you are bombarded with the noise from tires from the time you wake up to the time you go to bed… I hope the future is car-free especially considering the fact that the take up the most space but transports the least amount of people. |
| After launch | positive | 0.356 | When cars were banned from Central Park drivers whined and now we can’t imagine it any other way. Great episode. |
| After launch | neutral | 0.357 | Warren with the sick burn on both DT and MB!!! 🔥🔥🔥🔥🔥😂😂😂😂 |
| After launch | positive | 0.360 | funny stuff as always. serious ans makes me wanna cry too but…. |
| Before launch | positive | 0.362 | You’ll pay a fee and you’ll love it. You’ll also own nothing and you’ll love it. Geez, I wonder why the Democrats are losing the working class? |
| After launch | positive | 0.373 | As someone who lives in not New York, I’ve never been more proud (or aware) of what’s happening in New York |
Several positive labels in the sample praise the video or its host (“sam is great”, “Great episode”, “funny stuff as always”) rather than the policy. To see how common this is, I count positive comments that use words about the video itself.
video_praise <- youtube_sentiment %>%
filter(sentiment_label == "positive") %>%
mutate(about_video = str_detect(text_clean, regex(
"\\b(video|videos|episode|channel|content|rollie|sam|funny|hilarious|thanks|thank you)\\b",
ignore_case = T))) %>%
group_by(period) %>%
summarize(positive_comments = n(), share_about_video = mean(about_video), .groups = "drop")
video_praise %>%
knitr::kable(format = "html", escape = T, digits = 3,
col.names = c("Period", "Positive comments",
"Share mentioning the video, host or humor"))
| Period | Positive comments | Share mentioning the video, host or humor |
|---|---|---|
| Before launch | 96 | 0.219 |
| After launch | 345 | 0.357 |
Evaluation of the predictions. Most sampled labels match the comment’s tone. The Bay Area comment calling tolls “a tax on the people who commute” is clearly negative, and the comment saying congestion pricing “will absolutely benefit New York” is clearly positive. The errors follow three patterns:
- Tone is not the same as position on the policy. “London’s congestion charge absolutely worked… CARS DONT BELONG THERE” is labeled negative because of its angry tone, but it supports the policy. “Why dont they invest the money into NEW subway lines?” is labeled negative, but it is a suggestion, not opposition.
- Sarcasm. “You’ll pay a fee and you’ll love it… I wonder why the Democrats are losing the working class?” is labeled positive (with low confidence, 0.36), but it is sarcastic opposition.
- Praise for the video, not the policy. After launch, 36% of positive comments mention the video, host or humor, compared with 22% before launch. Part of the post-launch positivity is therefore about Climate Town, not congestion pricing.
About 23% of predictions in each period have low confidence (below 0.6), and only 5 comments were long enough to be truncated. Dropping the low-confidence predictions does not change the pattern: negative comments fall from 64.6% to 40.3% and positive comments rise from 10.8% to 38.3%. I therefore treat the labels as a measure of tone, not support, and I read the comments behind each theme before interpreting it.
Sentence-level check
Many comments mix views in one comment, for example complaining about the toll but admitting traffic improved. A single comment-level label hides that. To check how much this matters, I split each comment into sentences (as in the sentiment lab), ran the same Colab model on each sentence, and compare the results with the comment-level labels. I use the sentence results only as a check on the comment-level findings, since a sentence can lose the context of the rest of the comment.
# Run once, then upload youtube_sentences.csv to the same Colab notebook (RUN_SENTENCE_ANALYSIS = True)
youtube_sentences <- read_csv("youtube_comments.csv",
col_types = cols(comment_id = col_character())) %>%
select(comment_id, text) %>%
unnest_tokens(sentence_text, text, token = "sentences", to_lower = F) %>%
filter(str_trim(sentence_text) != "") %>%
group_by(comment_id) %>%
mutate(sentence_id = row_number()) %>%
ungroup() %>%
select(comment_id, sentence_id, sentence_text)
write_csv(youtube_sentences, "youtube_sentences.csv")
sentence_sentiment <- read_csv("youtube_sentences_sentiment.csv", show_col_types = F,
col_types = cols(comment_id = col_character())) %>%
# keep sentences from the comments used in this report and attach the period
inner_join(select(youtube_sentiment, comment_id, period), by = "comment_id") %>%
mutate(sentiment_label = factor(sentiment_label,
levels = c("negative", "neutral", "positive")))
# Sentence-level shares next to the comment-level shares
bind_rows(
youtube_sentiment %>% count(period, sentiment_label) %>% mutate(level = "Comments"),
sentence_sentiment %>% count(period, sentiment_label) %>% mutate(level = "Sentences")
) %>%
group_by(level, period) %>%
mutate(units = sum(n), proportion = n / units) %>%
ungroup() %>%
select(level, period, units, sentiment_label, proportion) %>%
pivot_wider(names_from = sentiment_label, values_from = proportion) %>%
arrange(level, period) %>%
knitr::kable(format = "html", escape = T, digits = 3,
col.names = c("Unit", "Period", "Number", "Negative", "Neutral", "Positive"))
| Unit | Period | Number | Negative | Neutral | Positive |
|---|---|---|---|---|---|
| Comments | Before launch | 915 | 0.584 | 0.311 | 0.105 |
| Comments | After launch | 1022 | 0.386 | 0.277 | 0.338 |
| Sentences | Before launch | 2453 | 0.500 | 0.408 | 0.092 |
| Sentences | After launch | 2281 | 0.376 | 0.376 | 0.248 |
# How many comments contain both a negative and a positive sentence?
sentence_sentiment %>%
group_by(period, comment_id) %>%
summarize(mixed = any(sentiment_label == "negative") & any(sentiment_label == "positive"),
.groups = "drop") %>%
group_by(period) %>%
summarize(comments = n(), mixed_comments = sum(mixed),
share_mixed = mean(mixed), .groups = "drop") %>%
knitr::kable(format = "html", escape = T, digits = 3,
col.names = c("Period", "Comments", "With both negative and positive sentences",
"Share"))
| Period | Comments | With both negative and positive sentences | Share |
|---|---|---|---|
| Before launch | 915 | 89 | 0.097 |
| After launch | 1022 | 103 | 0.101 |
# Read random sentences from each label to judge the sentence-level predictions
set.seed(1234)
sentence_sentiment %>%
filter(str_count(sentence_text, boundary("word")) >= 4) %>% # skip fragments
group_by(period, sentiment_label) %>%
slice_sample(n = 2) %>%
ungroup() %>%
select(period, sentiment_label, sentiment_score, sentence_text) %>%
knitr::kable(format = "html", escape = T, digits = 3,
col.names = c("Period", "Predicted", "Confidence", "Sentence"))
| Period | Predicted | Confidence | Sentence |
|---|---|---|---|
| Before launch | negative | 0.743 | The Bronx, despite not getting the shots that SI gets, is known to be the downbad borough. |
| Before launch | negative | 0.710 | The only option without having to bear the burden of this extra cost is to not accept the job. |
| Before launch | neutral | 0.775 | From Central Park to the Water front! |
| Before launch | neutral | 0.916 | New Delhi enters the chat ….. |
| Before launch | positive | 0.755 | Whatever is a priority for you, youll make room for. |
| Before launch | positive | 0.861 | Yes please this is needed and a first for North America |
| After launch | negative | 0.930 | Every time I watch one of these videos I’m reminded that I never, ever, EVER want to live in any major urban hellscape like NYC |
| After launch | negative | 0.926 | I had to drive into Manhattan recently and it was awful. |
| After launch | neutral | 0.575 | Btw, you say “only to the people who can afford a car,” as if that is not 91% of US households.” |
| After launch | neutral | 0.623 | My transit bill matches my food bill |
| After launch | positive | 0.835 | I come to NYC about once sometimes twice per week, i love congestion pricing, however most of times i take air rides on the chopper so hopefully they never try to tax air traffic and helipads over the city)) |
| After launch | positive | 0.768 | I am fully independent and free in my mobility. |
What the sentence-level check shows. Sentences are more often neutral than whole comments, because many sentences only describe or set up a point. The before/after difference is still there: negative sentences fall from 50.0% to 37.6% and positive sentences rise from 9.2% to 24.8%. The gap in positive tone is smaller than at the comment level (about 16 points instead of 23), so some comment-level positivity comes from a single positive closing line in otherwise mixed comments. Only about 10% of comments contain both a negative and a positive sentence, and the share is almost identical in both periods, so mixed comments do not explain the difference. The sampled sentence labels are mostly reasonable (“I had to drive into Manhattan recently and it was awful” is negative), but some lose their meaning without the rest of the comment, such as “I am fully independent and free in my mobility.” For this reason the main analysis stays at the comment level.
What changed in the conversation: distinctive words
To see what people talked about in each period, I compare how often words appear before and after launch. Raw word counts depend on how many comments and how long they are, so, as in the sentiment lab, I use the share of comments mentioning each word: each word counts at most once per comment, and I divide by the number of comments in that period. Words that appear in nearly every comment on this subject (congestion, pricing, video) are removed. I keep words mentioned in at least 10 comments overall so a single long comment cannot drive the result.
data("stop_words")
custom_stop <- tibble(word = c("congestion", "pricing", "video", "videos"))
comment_tokens <- youtube_sentiment %>%
select(comment_id, period, sentiment_label, text_clean) %>%
unnest_tokens(word, text_clean, token = "words") %>%
anti_join(stop_words, by = "word") %>%
anti_join(custom_stop, by = "word") %>%
filter(str_detect(word, "^[a-z']+$"), str_length(word) > 2)
# Most common words in each period
comment_tokens %>%
distinct(comment_id, period, word) %>%
count(period, word, sort = TRUE) %>%
group_by(period) %>%
slice_max(n, n = 10, with_ties = F) %>%
mutate(rank = row_number()) %>%
ungroup() %>%
select(rank, period, word) %>%
pivot_wider(names_from = period, values_from = word) %>%
knitr::kable(format = "html", escape = T,
caption = "Ten words mentioned in the most comments, by period")
| rank | Before launch | After launch |
|---|---|---|
| 1 | people | cars |
| 2 | city | people |
| 3 | nyc | city |
| 4 | manhattan | car |
| 5 | car | nyc |
| 6 | traffic | public |
| 7 | public | love |
| 8 | drive | traffic |
| 9 | cars | drive |
| 10 | money | money |
period_totals <- count(youtube_sentiment, period, name = "total_comments")
period_words <- comment_tokens %>%
distinct(comment_id, period, word) %>%
count(period, word, name = "comments_with_word") %>%
left_join(period_totals, by = "period") %>%
mutate(proportion = comments_with_word / total_comments) %>%
group_by(word) %>%
filter(sum(comments_with_word) >= 10) %>%
ungroup() %>%
select(word, period, proportion) %>%
pivot_wider(names_from = period, values_from = proportion, values_fill = 0) %>%
mutate(difference = `After launch` - `Before launch`)
period_comparison <- period_words %>%
slice_max(abs(difference), n = 20, with_ties = F)
period_comparison %>%
ggplot(aes(difference, reorder(word, difference),
fill = if_else(difference > 0, "After launch", "Before launch"))) +
geom_col() +
scale_fill_manual(values = period_colors) +
scale_x_continuous(labels = scales::percent) +
labs(x = "Share of comments mentioning the word: after minus before",
y = NULL, fill = "More common") +
theme_bw()
What the distinctive words show. Before launch, comments mention the practical details of the plan much more often: manhattan, transit, mta, traffic, money, subway, bus, pay, tax and parking each appear in 3 to 12 percentage points more of the comments. People were arguing about who would pay, where the money would go and whether the subway could absorb new riders. After launch, almost no policy word becomes more common; the clearest increase is love (about 5 points). The conversation after launch is less about the plan’s mechanics and more about reactions to it. In both periods, people, money and mta are tied to negative comments. After launch, rich, poor, tolls and pay join that list, which points to fairness as the objection that remained once the toll was real.
Words in negative versus positive comments
The same method, applied to sentiment instead of period, shows which words are tied to negative and to positive reactions. I do this separately for each period, because the reasons for being negative may have changed after launch.
sentiment_totals <- youtube_sentiment %>%
filter(sentiment_label %in% c("negative", "positive")) %>%
count(period, sentiment_label, name = "total_comments")
sentiment_words <- comment_tokens %>%
filter(sentiment_label %in% c("negative", "positive")) %>%
distinct(comment_id, period, sentiment_label, word) %>%
count(period, sentiment_label, word, name = "comments_with_word") %>%
left_join(sentiment_totals, by = c("period", "sentiment_label")) %>%
mutate(proportion = comments_with_word / total_comments) %>%
group_by(period, word) %>%
filter(sum(comments_with_word) >= 5) %>%
ungroup() %>%
select(period, word, sentiment_label, proportion) %>%
pivot_wider(names_from = sentiment_label, values_from = proportion, values_fill = 0) %>%
mutate(difference = positive - negative)
sentiment_words %>%
group_by(period) %>%
slice_max(abs(difference), n = 14, with_ties = F) %>%
ungroup() %>%
ggplot(aes(difference, reorder_within(word, difference, period),
fill = if_else(difference > 0, "positive", "negative"))) +
geom_col() +
facet_wrap(~period, scales = "free_y") +
scale_y_reordered() +
scale_fill_manual(values = sentiment_colors) +
scale_x_continuous(labels = scales::percent) +
labs(x = "Share of positive comments minus share of negative comments",
y = NULL, fill = "More common in") +
theme_bw()
This shows association with the comment’s overall label, not proof that the word itself is positive or negative.
Which concerns carry the tone: sentiment by keyword theme
The word comparisons show what changed, but not which concerns carry the negative tone. Here I define themes from the policy debate. Each theme is a set of keywords; a comment counts toward a theme if it mentions any of them (a comment can count toward several). I compare how often each theme is mentioned in each period and the sentiment of the comments that mention it.
themes <- c(
"Cost and tolls" = "toll|tolls|fee|fees|tax|taxes|charge|charged|pay|paying|price|cost|money",
"Traffic" = "traffic|gridlock|jam|jams|faster|commute|commutes",
"Transit and MTA" = "subway|subways|train|trains|bus|buses|transit|mta|metro",
"Drivers and cars" = "car|cars|drive|driving|driver|drivers|parking",
"Commuters and suburbs" = "jersey|nj|suburb|suburbs|suburban|commuter|commuters|bridge|tunnel",
"Politics" = "trump|hochul|governor|politician|politicians|democrats|republicans|government|federal",
"Fairness" = "poor|rich|wealthy|working|class|fair|unfair|afford|regressive",
"Other cities" = "london|stockholm|singapore|europe|european"
)
theme_comments <- imap_dfr(themes, function(pattern, theme) {
youtube_sentiment %>%
filter(str_detect(text_clean, regex(str_c("\\b(", pattern, ")\\b"), ignore_case = T))) %>%
mutate(theme = theme)
})
theme_summary <- theme_comments %>%
group_by(theme, period) %>%
summarize(comments = n(),
negative = mean(sentiment_label == "negative"),
positive = mean(sentiment_label == "positive"),
.groups = "drop") %>%
left_join(period_totals, by = "period") %>%
mutate(mention_share = comments / total_comments)
# How often each theme is mentioned, by period
theme_summary %>%
ggplot(aes(reorder(theme, mention_share), mention_share, fill = period)) +
geom_col(position = "dodge") +
coord_flip() +
scale_fill_manual(values = period_colors) +
scale_y_continuous(labels = scales::percent) +
labs(x = NULL, y = "Share of comments mentioning the theme", fill = NULL) +
theme_bw()
theme_comments %>%
left_join(select(theme_summary, theme, period, comments), by = c("theme", "period")) %>%
mutate(theme_label = str_c(theme, " (n=", comments, ")")) %>%
# order themes by their share of negative comments
ggplot(aes(y = reorder(theme_label, sentiment_label == "negative"), fill = sentiment_label)) +
geom_bar(position = "fill") +
facet_wrap(~period, scales = "free_y") +
scale_fill_manual(values = sentiment_colors) +
scale_x_continuous(labels = scales::percent) +
labs(y = NULL, x = "Share of comments", fill = "Predicted sentiment") +
theme_bw()
This uses the sentiment of the whole comment, which may not be aimed at the keyword itself. A negative comment that mentions traffic may be complaining about traffic, not about the toll, so I read examples before interpreting a theme.
# A few of the most-liked comments in the two largest themes, for context
theme_comments %>%
filter(theme %in% c("Cost and tolls", "Traffic")) %>%
group_by(theme, period) %>%
slice_max(like_count, n = 2, with_ties = F) %>%
ungroup() %>%
select(theme, period, sentiment_label, like_count, text) %>%
knitr::kable(format = "html", escape = T,
col.names = c("Theme", "Period", "Predicted", "Likes", "Comment"))
| Theme | Period | Predicted | Likes | Comment |
|---|---|---|---|---|
| Cost and tolls | Before launch | negative | 6730 | I’ve got a buddy who lives in NY- and trust me, owning a car in Manhattan is no joke. You can barely drive and use it, you must pay to park it everyday, and even if you dont use it, you must move it every week as to not get towed. It’s a headache, it’s a waste of space, and it actually burns a hole in your pocket. |
| Cost and tolls | Before launch | neutral | 5523 |
There’s an important statistic you missed: Over 90% of people who commute into lower Manhattan do so by mass transit. All the furor over congestion pricing only serves the 10% who don’t. Also, the congestion pricing toll would not be per trip, but per day, which would make it much easier to amortize into the cost of doing business for taxis, rideshares, delivery vehicles, and all the other vehicles which can be expected to make multiple trips into lower Manhattan every day. |
| Cost and tolls | After launch | negative | 892 | London’s congestion charge absolutely worked. It made people hate driving into central more which is GOOD CAUSE CARS DONT BELONG THERE. |
| Cost and tolls | After launch | negative | 695 | London has had the same issue. Three times: Once over the congestion charging, once over the ULEZ zone for restricting the more polluting vehicles in an effort to alleviate the city’s dangerously toxic air, and a final time for when the ULEZ was expanded. Same pattern every time: Lots of anger from people who actually have to pay the fee, but everyone else is in favor. |
| Traffic | Before launch | neutral | 5523 |
There’s an important statistic you missed: Over 90% of people who commute into lower Manhattan do so by mass transit. All the furor over congestion pricing only serves the 10% who don’t. Also, the congestion pricing toll would not be per trip, but per day, which would make it much easier to amortize into the cost of doing business for taxis, rideshares, delivery vehicles, and all the other vehicles which can be expected to make multiple trips into lower Manhattan every day. |
| Traffic | Before launch | neutral | 3030 | “The only solution to car traffic is viable alternatives to driving!” |
| Traffic | After launch | positive | 1138 | “We hate it, we try it, we love it.” So true! Boston here. People had to get killed before some “traffic calming” implemented on a bad street in my city neighborhood. People fought it like it was an enemy invasion and it took 4 years but now everyone thinks it was their idea and love it. Excellent episode! |
| Traffic | After launch | negative | 405 | Whenever Trump is next in town they should have a “no congestion charge day”. Traffic will be hell on earth. |
Findings
1. Comments were much less negative after launch, but not all of that change is about the policy. The share of negative comments fell from 58.4% before launch to 38.6% after, and the share of positive comments tripled from 10.5% to 33.8%. The shift holds when low-confidence predictions are removed and when sentences are analyzed instead of whole comments. Two cautions limit how far this goes: a noticeable part of the post-launch positivity praises the video or its host, and Climate Town’s audience is more pro-transit than Wendover’s. The shift is real in these comment sections, but it combines a change over time with a change in audience.
2. Before launch, viewers argued about the plan’s mechanics and costs; after launch, that debate faded. Most themes were mentioned less after launch; only politics and comparisons with other cities rose slightly. Cost and tolls fell from 33% to 19% of comments, transit and the MTA from 30% to 14%, traffic from 17% to 9%, and commuters and suburbs from 9% to 3%. The distinctive-word comparison shows the same thing: words about Manhattan, the MTA, money, taxes and transit options belong to the pre-launch comments. Before launch, viewers were speculating about how the toll would work and who would carry it.
3. Positive reactions after launch center on outcomes, while cost, fairness and politics stay negative. After launch, comments about traffic, transit, driving and other cities became much more positive: about a quarter to a third of them are positive, compared with under 10% before launch. These are comments reporting faster trips or pointing to London and Stockholm as proof that the policy works. Comments about cost and tolls, fairness and politics stayed mostly negative (roughly 60% to 75% negative in both periods), and fairness became the most negative theme after launch. The most-liked comments make the same point: one of the top London comments notes that people who pay the fee are angry “but everyone else is in favor.”
Answer to the research question
YouTube viewers responded to NYC congestion pricing more favorably after it launched than before. Negative comments dropped from about 58% to 39% and positive comments rose from about 11% to 34%. The change came mainly from comments about results: less traffic, better transit and comparisons with cities that already have congestion charges. Before launch, the conversation was dominated by worries about cost, the MTA and how commuters would be affected. After launch, those worries were mentioned much less often, but they did not soften. Comments about tolls, fairness to lower-income drivers and politics remained mostly negative in both periods. The evidence suggests that seeing the policy work reduced general skepticism, while the objection about who pays persisted. Because the two videos reach different audiences and the model measures tone rather than support, this is a pattern in these two comment sections, not a measure of New Yorkers’ opinion.