Research Question

What is the prevailing sentiment toward autonomous ridesharing services in American cities? What factors shape this sentiment?

Selected Videos

1. ‘Amazon Just Launched Its Zoox Robotaxis In Las Vegas And We Took A Ride’, CNBC

National business news coverage of the launch of Zoox’s autonomous ride-hailing service in Las Vegas, including a firsthand passenger experience and an overview of the technology.

2. ‘Inside Waymo’s New Robotaxi – The Ojai’, CNBC

Coverage of Waymo’s next-generation autonomous vehicles, focusing on vehicle design, passenger experience, technology, and service expansion.

3. ‘Waymo Leads The 2025 Robotaxi Surge As Zoox Expands And Tesla Races To Catch Up’, CNBC

A broader overview of the autonomous ride-hailing industry, covering the expansion of services by multiple operators, including Waymo, Zoox, and Tesla.

Rationale

My goal is to obtain a relatively balanced and diverse sample of public sentiment toward autonomous ride-hailing services. These three videos represent coverage of different service providers and aspects of the emerging robotaxi industry from the same journalistic source, allowing for some consistency in editorial framing. Furthermore, many of the highest-engagement videos on this topic are responsive to negative events, such as accidents or operational failures, which could skew the sentiment of the collected comments. The selected videos take a more general and informational approach while having sufficient engagement to potentially provide a substantial sample of comments. Although YouTube comments cannot be considered a random or representative sample of the general public, combining comments from these three videos should capture a broader range of perspectives than relying on a single video.

video_ids <- c("lIRW8bfy4kE", "RQaW3iMue3M", "vgEfyF9juOA")

# Defining function for API calls

getYoutubeAPI <- function(video_id, max_comments = 500) {
  api_key <- Sys.getenv("GOOGLE_API_KEY")
  comments_list <- list()
  page_token <- NULL
  n_collected <- 0

  repeat {
    response <- request("https://www.googleapis.com/youtube/v3/commentThreads") %>%
      req_url_query(
        part = "snippet",
        videoId = video_id,
        maxResults = min(100, max_comments - n_collected),
        order = "relevance",
        textFormat = "plainText",
        pageToken = page_token,
        key = api_key
      ) %>%
      req_perform() %>%
      resp_body_json()

    comments <- map_dfr(response$items, function(x) {
      comment <- x$snippet$topLevelComment

      tibble(
        video_id = video_id,
        comment_id = comment$id,
        text = comment$snippet$textOriginal,
        likes = comment$snippet$likeCount,
        published_at = comment$snippet$publishedAt,
        updated_at = comment$snippet$updatedAt,
        reply_count = x$snippet$totalReplyCount
      )
    })

    comments_list[[length(comments_list) + 1]] <- comments
    n_collected <- n_collected + nrow(comments)
    page_token <- response$nextPageToken

    if (is.null(page_token) || n_collected >= max_comments) {
      break
    }
  }

  bind_rows(comments_list)
}
# API call for the three videos
youtubeComments <- map_dfr(video_ids, getYoutubeAPI)
write_csv(youtubeComments, "youtube_comments.csv")
youtubeComments <- read_csv("youtube_comments.csv")

A total of 1,340 top-level comments were collected, comprising 500 comments from the Zoox Launch video, 500 from the Waymo Ojai video, and 340 from the Robotaxi Industry video. Comments were collected using YouTube’s relevance ordering, with a maximum of 500 comments per video. No comments were excluded based on engagement or predicted sentiment.

sentiments <- read_csv("youtube_comments_sentiment.csv")
head(sentiments)
## # A tibble: 6 × 14
##   video_id    comment_id     text  likes published_at        updated_at         
##   <chr>       <chr>          <chr> <dbl> <dttm>              <dttm>             
## 1 lIRW8bfy4kE UgwN6FqaXWWx_… Imag…   700 2025-09-11 00:42:40 2025-09-11 00:42:40
## 2 lIRW8bfy4kE Ugxl5KBEkst9d… Plot…   612 2025-09-10 18:56:25 2025-09-10 18:56:25
## 3 lIRW8bfy4kE Ugw-Jv9PaBz2_… This…   209 2025-09-10 17:00:59 2025-09-10 17:00:59
## 4 lIRW8bfy4kE Ugz-DKtNo-iT9… The …   419 2025-09-10 14:26:40 2025-09-10 14:26:40
## 5 lIRW8bfy4kE Ugw6C9565Yxug… I'm …   691 2025-09-10 15:52:58 2025-09-10 15:52:58
## 6 lIRW8bfy4kE UgynSMf9576n2… I li…   194 2025-09-10 19:48:37 2025-09-10 19:48:37
## # ℹ 8 more variables: reply_count <dbl>, model_token_count <dbl>,
## #   text_truncated <lgl>, sentiment_label <chr>, sentiment_score <dbl>,
## #   negative_score <dbl>, neutral_score <dbl>, positive_score <dbl>

Colab data was loaded succesfully and contains sentiment scores for every comment.

Initial Sentiment Analysis and Model Evaluation

#Defining colors used throughout the analysis
sentiment_colors <- c(
  negative = "#dc6666",
  neutral = "#7b8794",
  positive = "#3aae90"
)


youtube_sentiment <- youtubeComments |>
  left_join(
    sentiments |>
      select(comment_id, sentiment_label, sentiment_score,
             negative_score, neutral_score, positive_score,
             model_token_count, text_truncated),
    by = "comment_id"
  ) |>
  mutate(
    sentiment_label = factor(
      sentiment_label,
      levels = c("negative", "neutral", "positive")
    ),
    video = case_when(
      video_id == "lIRW8bfy4kE" ~ "Zoox Launch",
      video_id == "RQaW3iMue3M" ~ "Waymo Ojai",
      video_id == "vgEfyF9juOA" ~ "Robotaxi Industry"
    ),
    word_count = str_count(text, boundary("word"))
  )

stopifnot(
  !anyDuplicated(youtube_sentiment$comment_id),
  !anyNA(youtube_sentiment$sentiment_label)
)

Net sentiment is calculated as the difference between the predicted probabilities of positive and negative sentiment and the resulting score ranges from -1 to +1.

youtube_sentiment <- youtube_sentiment |>
  mutate(net_sentiment = positive_score - negative_score)

youtube_sentiment |>
  group_by(video) |>
  summarize(
    comments = n(),
    mean_sentiment = mean(net_sentiment),
    median_sentiment = median(net_sentiment),
    sd_sentiment = sd(net_sentiment),
    .groups = "drop"
  ) |>
  kable(digits = 3)
video comments mean_sentiment median_sentiment sd_sentiment
Robotaxi Industry 340 -0.179 -0.240 0.602
Waymo Ojai 500 -0.139 -0.113 0.550
Zoox Launch 500 0.042 0.001 0.590
youtube_sentiment |>
  count(sentiment_label, name = "Comments") |>
  mutate(Percent = round(Comments * 100 / sum(Comments), 2)) |>
  kable(
    col.names = c("Predicted Sentiment", "Comments", "Proportion"),
    caption = "Overall Sentiment Distribution"
  ) |>
  kable_styling(full_width = FALSE)
Overall Sentiment Distribution
Predicted Sentiment Comments Proportion
negative 473 35.30
neutral 548 40.90
positive 319 23.81
sentiment_distribution <- bind_rows(
  youtube_sentiment |>
    count(video, sentiment_label, name = "comments"),
  youtube_sentiment |>
    count(sentiment_label, name = "comments") |>
    mutate(video = "All Videos")
) |>
  group_by(video) |>
  mutate(proportion = comments / sum(comments)) |>
  ungroup() |>
  mutate(
    video = factor(
      video,
      levels = c("Zoox Launch", "Waymo Ojai", 
                 "Robotaxi Industry", "All Videos")
    )
  )

sentiment_distribution |>
  ggplot(aes(sentiment_label, proportion, fill = sentiment_label)) +
  geom_col(show.legend = FALSE, width = 0.65) +
  geom_text(
    aes(label = scales::percent(proportion, accuracy = 0.1)),
    vjust = -0.5
  ) +
  facet_wrap(~video, ncol = 2) +
  scale_fill_manual(values = sentiment_colors) +
  scale_y_continuous(
    labels = scales::percent,
    expand = expansion(mult = c(0, 0.1))
  ) +
  labs(
    title = "Sentiment Toward Autonomous Ride-Hailing",
    x = "Predicted Sentiment",
    y = "Proportion of Comments"
  ) +
  theme_minimal() +
  theme(
    strip.text = element_text(face = "bold", size = 11)
  )

youtube_sentiment |>
  ggplot(aes(video, net_sentiment, fill = video)) +
  geom_violin(alpha = 0.5, show.legend = FALSE) +
  geom_boxplot(width = 0.15, outlier.shape = NA,
               show.legend = FALSE) +
  stat_summary(
    fun = mean,
    geom = "point",
    shape = 23,
    size = 3,
    fill = "white"
  ) +
  geom_hline(yintercept = 0, linetype = "dashed") +
  labs(
    title = "Distribution of Net Sentiment by Video",
    subtitle = "White diamonds indicate group means",
    x = NULL,
    y = "Net Sentiment Score"
  ) +
  theme_minimal()

set.seed(1234)

manual_examples <- youtube_sentiment |>
  group_by(sentiment_label) |>
  slice_sample(n = 10) |>
  ungroup() |>
  select(video, sentiment_label, sentiment_score, text)

manual_examples |>
  kable(
    format = "html",
    escape = TRUE,
    digits = 3,
    col.names = c("Video", "Predicted Sentiment", "Confidence", "Comment"),
    caption = "Random Sample of Sentiment Predictions"
  ) |>
  kable_styling(
    bootstrap_options = c("striped", "condensed"),
    full_width = TRUE
  )
Random Sample of Sentiment Predictions
Video Predicted Sentiment Confidence Comment
Waymo Ojai negative 0.905 How the heck is this minivan any more “purpose built” than the hideous barnacle-encrusted Jaguar I-Pace? It’s getting the same clunky post-factory retrofit. Cheaper yes, but “purpose built”? Absolutely not.
Robotaxi Industry negative 0.894 Why do we need this 😢
Robotaxi Industry negative 0.874 Tesla is like that girl who promises a date and never shows up.
Zoox Launch negative 0.509 No drivers….and NO passengers!
Zoox Launch negative 0.871 Uber/lyft is super expensive now they need to change
Robotaxi Industry negative 0.699 another hit piece on Tesla
Zoox Launch negative 0.799 I understand needing a easily cleanable seat. But that colored hard plastic looks like a kids car seat and uncomfortable af
Robotaxi Industry negative 0.947 Who is going to keep these things clean?!? Dirty, slow and expensive. Hard pass…
Robotaxi Industry negative 0.954 Laura is a joke of a journalist and a shill. CNBC should be ashamed.
Robotaxi Industry negative 0.794 Waymotarded waymo accidents.
Zoox Launch neutral 0.500 😂😂😂😂😂 I could’ve sworn it hit the car in front of it maybe not- Whathappens in Vegas doesn’t stay in Vegas
Zoox Launch neutral 0.536 Hopefully people won’t leave garbage or vandalize them. I presume there are cameras inside to monitor passengers and for safety.
Waymo Ojai neutral 0.599 I didn’t know they were Jaguars, now China Ojai are taking over - of course 😄
Zoox Launch neutral 0.715 I saw 4 of these drive into construction on Las Vegas BLVD 😂
Waymo Ojai neutral 0.777 Jaguar. Not Jaguire.
Waymo Ojai neutral 0.492 lol. Waymo? They still around. Not for long.
Zoox Launch neutral 0.485 How is retrofitting a existing platform more expensive than building a completely different platform? Tesla removes the steering wheel and pedals and reduces the cost
Zoox Launch neutral 0.471 anything that prevents humans from driving is an enormous positive
Waymo Ojai neutral 0.548 So US corporations can buy China-made cars that can drive on US soil, but ordinary consumers can’t buy cheap Chinese-made cars.
Zoox Launch neutral 0.571 Mark these words: Tesla robotaxis will adopt lidar technology.
Zoox Launch positive 0.883 Very cool, but where’s the trunk?
Zoox Launch positive 0.448 What a commercial!!!
Zoox Launch positive 0.973 good news. i want to see then in Greece soon
Waymo Ojai positive 0.952 A million rides per week is insane. They have grown so fast after a long startup period.
Robotaxi Industry positive 0.584 Elon said in a test vehicle the human control operator will be seated in the front passenger seat!!! Oh, that will be 100% effective as all the braking and steering systems are on the driver’s side!!! And its cars operate with vision instead of radar!!! More crashes are coming - right Elon??!!!
Zoox Launch positive 0.788 Soft boots that you can put over your shoes and that allow you to put your feet up on the opposite seat are going to be a huge success in the aftermarket People will carry them in their backpacks and put them on as soon as they enter the vehicle
Zoox Launch positive 0.564 Rachelle Delapina how show you best mobile car technology for the taxi and uber Lyft choose anywhere best support for the car
Zoox Launch positive 0.978 Just rose in one of these Zoox vehicles, great ride. Very surprised
Zoox Launch positive 0.711 May not be profitable as Taxi, but imagine how this could transform the lives of those with restricted mobility or who could not otherwise operate or get into a normal car - even the drive vehicle seems perfect for wheelchair users and would give them much needed freedom - or partially sighted people etc. Also as non-emergency ambulances for shuttling elderly people to hospital at odd hours from a care home etc,
Waymo Ojai positive 0.760 oh hi, i upgraded your RAM

Across the 1,340 comments collected, neutral sentiment was the most prevalent (40.9%), followed by negative (35.3%) and positive (23.8%) sentiment. This suggests that the overall discourse surrounding autonomous ride-hailing is mixed but leans negative.

There are noticeable differences between the three videos. The Zoox Launch video received a greater proportion of positive comments and was the only video with a positive mean net sentiment (0.042). The Waymo Ojai and Robotaxi Industry videos exhibited negative mean net sentiment (-0.139 and -0.179, respectively). The violin plots reveal considerable variation in sentiment within each video, with the robotaxi industry video leaning negative.

Randomly sampled comments suggest that the sentiment model generally captures the emotional tone of comments but struggles with interpreting sarcasm, mixed opinions, and the target of criticism. Comments also criticize CNBC’s political leanings and reporting, which are factored into aggregate sentiment and create room for error.

Given the differences in the distributions of the three videos, I decided to hypothesis testing to see if there is significance in the differences between the two videos:

oneway.test(
  net_sentiment ~ video,
  data = youtube_sentiment,
  var.equal = FALSE
)
## 
##  One-way analysis of means (not assuming equal variances)
## 
## data:  net_sentiment and video
## F = 18.092, num df = 2.00, denom df = 817.36, p-value = 2.049e-08
pairwise.t.test(
  youtube_sentiment$net_sentiment,
  youtube_sentiment$video,
  pool.sd = FALSE,
  p.adjust.method = "holm"
)
## 
##  Pairwise comparisons using t tests with non-pooled SD 
## 
## data:  youtube_sentiment$net_sentiment and youtube_sentiment$video 
## 
##             Robotaxi Industry Waymo Ojai
## Waymo Ojai  0.33              -         
## Zoox Launch 5.8e-07           1.3e-06   
## 
## P value adjustment method: holm

I used Welch’s one-way ANOVA to determine whether mean net sentiment differed significantly across the three videos. The results indicate a statistically significant difference: (\(F = 18.092\), \(p < 0.001\)).

Then I did pairwise Welch’s t-tests with Holm correction to see which videos cause the difference. This revealed that the Zoox Launch video exhibits significantly more positive mean sentiment than both the Waymo Ojai and Robotaxi Industry videos (\(p < 0.001\)). The other two videos do not show statistically significant difference.

Hence, for the rest of the analysis, I tried to examine the Zoox video’s statistical aggregations seperately to create a more distinct understanding of public sentiment.

Vocabulary Associated with Positive and Negative Sentiment

data("stop_words") # Loading stop words to filter them out

# Tokenizing for analysis

sentiment_tokens <- youtube_sentiment |>
  filter(sentiment_label %in% c("positive", "negative")) |> # Only using positive and negative labels
  select(comment_id, video, sentiment_label, text) |>
  mutate(
    text = str_remove_all(text, "https?://\\S+"),
    text = str_squish(text)
  ) |>
  unnest_tokens(word, text, token = "words") |>
  anti_join(stop_words, by = "word") |>
  filter(
    str_detect(word, "^[a-z']+$"),
    str_length(word) > 2
  )

I initially implemented word clouds, but they did not reveal any useful insight related to the research question, so they were removed from the analysis

Assessing word prevalence

sentiment_totals <- bind_rows(
  youtube_sentiment,
  youtube_sentiment |>
    mutate(video = "All Videos")
) |>
  filter(sentiment_label %in% c("positive", "negative")) |>
  count(video, sentiment_label, name = "total_comments")

word_prevalence <- bind_rows(
  sentiment_tokens,
  sentiment_tokens |>
    mutate(video = "All Videos")
) |>
  distinct(video, comment_id, sentiment_label, word) |>
  count(video, sentiment_label, word, name = "comments_with_word") |>
  left_join(sentiment_totals, by = c("video", "sentiment_label")) |>
  mutate(proportion = comments_with_word / total_comments) |>
  group_by(video, word) |>
  filter(sum(comments_with_word) >= 5) |>
  ungroup() |>
  select(video, word, sentiment_label, proportion) |>
  pivot_wider(
    names_from = sentiment_label,
    values_from = proportion,
    values_fill = 0
  ) |>
  mutate(difference = positive - negative)
word_comparison <- bind_rows(
  word_prevalence |>
    filter(difference > 0) |>
    group_by(video) |>
    slice_max(difference, n = 10, with_ties = FALSE),
  word_prevalence |>
    filter(difference < 0) |>
    group_by(video) |>
    slice_min(difference, n = 10, with_ties = FALSE)
) |>
  ungroup() |>
  mutate(
    association = if_else(difference > 0, "positive", "negative"),
    video = factor(
      video,
      levels = c("Zoox Launch", "Waymo Ojai",
                 "Robotaxi Industry", "All Videos")
    ),
    word = tidytext::reorder_within(word, difference, video)
  )

word_comparison |>
  ggplot(aes(
    x = difference,
    y = word,
    fill = association
  )) +
  geom_col(show.legend = FALSE) +
  geom_vline(xintercept = 0, color = "black") +
  facet_wrap(~video, ncol = 2, scales = "free_y") +
  tidytext::scale_y_reordered() +
  scale_fill_manual(values = sentiment_colors) +
  scale_x_continuous(labels = scales::percent) +
  labs(
    title = "Words Distinctive to Positive and Negative Comments",
    subtitle = "Difference in word prevalence between sentiment categories",
    x = "Positive Prevalence − Negative Prevalence",
    y = NULL
  ) +
  theme_minimal() +
  theme(
    strip.text = element_text(face = "bold", size = 11),
    panel.spacing = unit(1, "cm")
  )

The most frequent words in positive comments suggest enthusiasm about technological innovation, vehicle design, and the future of autonomous transportation. Negative comments frequently include words such as “drivers”, “jobs”, “cost”, and “Chinese”, suggesting concerns surrounding employment displacement, affordability, and international competition.

Several differences emerge between the individual videos. Positive comments on the Zoox video are particularly associated with vehicle design and technological optimism, while negative comments on the Waymo video are more closely associated with Chinese manufacturing, employment, and economic concerns. Negative comments on the Robotaxi Industry video also frequently reference perceived journalistic bias and Tesla.

Assessing Engagement

I am using like count and reply count as a measure of public engagement. Since the data is very zero-heavy, I used the 90th percentile of engagement in each group as th cutoff to be classified as ‘High Engagement’.

youtube_sentiment <- youtube_sentiment |>
  group_by(video) |>
  mutate(
    likes_threshold = quantile(likes, 0.90),
    replies_threshold = quantile(reply_count, 0.90),
    high_likes = likes >= likes_threshold & likes > 0,
    high_replies = reply_count >= replies_threshold & reply_count > 0,
    engagement_category = case_when(
      high_likes | high_replies ~ "High Engagement",
      TRUE ~ "Regular Engagement"
    )
  ) |>
  ungroup()

youtube_sentiment |>
  group_by(video) |>
  summarize(
    total_comments = n(),
    likes_threshold = first(likes_threshold),
    replies_threshold = first(replies_threshold),
    high_likes = sum(high_likes),
    high_replies = sum(high_replies),
    high_engagement = sum(engagement_category == "High Engagement"),
    proportion = scales::percent(high_engagement / total_comments,
                                 accuracy = 0.1),
    .groups = "drop"
  ) |>
  kable(
    digits = 2,
    col.names = c(
      "Video", "Comments", "Likes Threshold",
      "Replies Threshold", "High Likes", "High Replies",
      "High Engagement", "Share"
    ),
    caption = "High Engagement Classification by Video"
  ) |>
  kable_styling(full_width = FALSE)
High Engagement Classification by Video
Video Comments Likes Threshold Replies Threshold High Likes High Replies High Engagement Share
Robotaxi Industry 340 12 4 36 45 59 17.4%
Waymo Ojai 500 5 2 52 59 79 15.8%
Zoox Launch 500 6 2 55 59 74 14.8%

The three videos show a similar proportion of higher engagement comment share, with the thresholds roughly proportional to the overall video views.

bind_rows(
  youtube_sentiment,
  youtube_sentiment |>
    mutate(video = "All Videos")
) |>
  count(video, engagement_category, sentiment_label, name = "comments") |>
  group_by(video, engagement_category) |>
  mutate(proportion = comments / sum(comments)) |>
  ungroup() |>
  mutate(
    video = factor(
      video,
      levels = c("Zoox Launch", "Waymo Ojai",
                 "Robotaxi Industry", "All Videos")
    ),
    engagement_category = factor(
      engagement_category,
      levels = c("Regular Engagement", "High Engagement")
    )
  ) |>
  ggplot(aes(engagement_category, proportion, fill = sentiment_label)) +
  geom_col(width = 0.65) +
  geom_text(
    aes(label = scales::percent(proportion, accuracy = 0.1)),
    position = position_stack(vjust = 0.5),
    size = 3.5
  ) +
  facet_wrap(~video, ncol = 2) +
  scale_fill_manual(values = sentiment_colors) +
  scale_y_continuous(labels = scales::percent) +
  labs(
    title = "Sentiment Distribution by Engagement Category",
    subtitle = "Comparison of regular and high-engagement comments",
    x = NULL,
    y = "Proportion of Comments",
    fill = "Predicted Sentiment"
  ) +
  theme_minimal() +
  theme(
    strip.text = element_text(face = "bold", size = 11),
    legend.position = "bottom",
    panel.spacing = unit(1, "cm")
  )

sentiment_table <- table(
  youtube_sentiment$engagement_category,
  youtube_sentiment$sentiment_label
)

chisq.test(sentiment_table)
## 
##  Pearson's Chi-squared test
## 
## data:  sentiment_table
## X-squared = 2.6938, df = 2, p-value = 0.26

High-engagement comments exhibit a slightly greater proportion of positive sentiment (27.8%) compared to regular comments (23.0%). However, these patterns are not consistent across the three videos.

I did a chi-square test to assess wether there is any statistical significance in the categorical differences in each group. Engagement category and sentiment do not seem to differ significantly (\(\chi^2 = 2.694\), \(p = 0.260\)).

Hence, I decided not to treat higher-engagement comments seperately or with different weights for the rest of the analysis.

Assessing differences between the Zoox video and other videos

So far, it seems like the popular sentiment is negative, and most of the positive sentiment is reflected in the Zoox video. Therefore, in this section, I hope to analyze what attributes of the Zoox video are driving the positive engagement. I am hoping the understand the thematic differences that seem to divide public opinion on the topic.

Here, I use words that have the highest difference in frequencies between comments for the two sets of videos.

# Excluding words that would obscure meaningful thematic differences

excluded_words <- c(
  "zoox", "waymo", "tesla", "amazon", "google", "uber",
  "jaguar", "jag", "zeekr", "ojai", "alphabet",
  "vegas", "las", "francisco", "san", "austin", "atlanta",
  "car", "cars", "vehicle", "vehicles",
  "robotaxi", "robotaxis", "taxi", "taxis", "cab", "cabs",
  "autonomous", "driverless", "self", "driving", "drive",
  "ride", "rides", "rideshare", "ridesharing", "hailing",
  "people", "thing", "things", "video", "videos",
  "make", "made", "making", "taking", "going", "getting",
  "time", "years", "year", "lot", "day", "ways"
)

comparison_comments <- youtube_sentiment |>
  mutate(
    video_group = if_else(
      video == "Zoox Launch",
      "Zoox",
      "Other Videos"
    )
  )

group_totals <- comparison_comments |>
  count(video_group, name = "total_comments")

comparison_tokens <- comparison_comments |>
  select(comment_id, video_group, sentiment_label, text) |>
  mutate(
    text = str_remove_all(text, "https?://\\S+"),
    text = str_squish(text)
  ) |>
  unnest_tokens(word, text, token = "words") |>
  anti_join(stop_words, by = "word") |>
  filter(
    str_detect(word, "^[a-z']+$"),
    str_length(word) > 2
  )

video_word_prevalence <- comparison_tokens |>
  distinct(comment_id, video_group, word) |>
  count(video_group, word, name = "comments_with_word") |>
  left_join(group_totals, by = "video_group") |>
  mutate(proportion = comments_with_word / total_comments) |>
  group_by(word) |>
  filter(sum(comments_with_word) >= 5) |>
  ungroup() |>
  select(video_group, word, proportion) |>
  pivot_wider(
    names_from = video_group,
    values_from = proportion,
    values_fill = 0
  ) |>
  mutate(difference = Zoox - `Other Videos`)

video_word_comparison <- bind_rows(
  video_word_prevalence |>
    filter(difference > 0, !word %in% excluded_words) |>
    slice_max(difference, n = 25, with_ties = FALSE),
  video_word_prevalence |>
    filter(difference < 0, !word %in% excluded_words) |>
    slice_min(difference, n = 25, with_ties = FALSE)
) |>
  mutate(
    association = if_else(
      difference > 0,
      "Zoox",
      "Other Videos"
    )
  )

video_word_comparison |>
  ggplot(aes(
    x = difference,
    y = reorder(word, difference),
    fill = association
  )) +
  geom_col() +
  geom_vline(xintercept = 0, color = "black") +
  scale_fill_manual(values = c(
    "Zoox" = "#348c91",
    "Other Videos" = "#8275a8"
  )) +
  scale_x_continuous(labels = scales::percent) +
  labs(
    title = "Distinctive Words: Zoox vs. Other Videos",
    subtitle = "Differences in the proportion of comments mentioning each word",
    x = "Zoox Prevalence − Other Videos Prevalence",
    y = NULL,
    fill = NULL
  ) +
  theme_minimal() +
  theme(legend.position = "bottom")

Now incorporating sentiment into the analysis of distinctive words:

distinctive_words <- video_word_comparison |>
  pull(word) |>
  unique()

word_sentiment <- comparison_tokens |>
  filter(word %in% distinctive_words) |>
  distinct(comment_id, video_group, word) |>
  left_join(
    youtube_sentiment |>
      select(comment_id, net_sentiment),
    by = "comment_id"
  ) |>
  group_by(video_group, word) |>
  summarize(
    comments = n(),
    mean_sentiment = mean(net_sentiment),
    .groups = "drop"
  ) |>
  filter(comments >= 5)

word_sentiment |>
  ggplot(aes(
    x = mean_sentiment,
    y = reorder(word, mean_sentiment),
    color = video_group,
    size = comments
  )) +
  geom_point(alpha = 0.8) +
  geom_vline(xintercept = 0, linetype = "dashed") +
  scale_color_manual(values = c(
    "Zoox" = "#348c91",
    "Other Videos" = "#8275a8"
  )) +
  scale_x_continuous(limits = c(-1, 1)) +
  labs(
    title = "Sentiment Associated with Distinctive Words",
    subtitle = "Mean net sentiment of comments mentioning each word",
    x = "Mean Net Sentiment",
    y = NULL,
    color = "Video Group",
    size = "Comments"
  ) +
  theme_minimal()

Comments on the Zoox video more frequently discuss vehicle design, passenger experience, and practical applications of autonomous mobility, as reflected by words such as “design”, “luggage”, “seats”, “bus”, and “trunk”.Cmments on the other two videos more frequently reference international competition, economic concerns, and perceived journalistic bias.

Comparing the mean net sentiment associated with these distinctive words shows that terms such as “design”, “concept”, and “future” are associated with relatively positive sentiment in the Zoox discussion. Meanwhile, terms such as “Chinese”, “jobs”, “bias”, and “CNBC” are associated with negative sentiment in the other videos. Cost-related vocabulary is weakly associated with negative sentiment across both groups.

This leads to the final section of the analysis, which aims to aggregate the trends indicated by the vocabulary analysis to investigate broader thematic attitudes in public sentiment.

Thematic Analysis

Disclosure: I used AI to help iteratively construct the set of themes present in the ‘keywords’ vector. Sets of words were assessed to belong to different themes and added to the lists. I then looked at random samples of how comments were classified to look for exceptions and overlooked cases to update the list.

Note: The lists are not mutually exclusive, and one comment can be assigned to multiple themes. Theme-group combinations must have at least 10 comments.

# Defining themes by keywords present in comments.

keywords <- c(
  "Safety" = "safe|safety|unsafe|crash|crashes|accident|accidents|dangerous",
  "Employment" = "job|jobs|employment|unemployment|workers|livelihood|wages",
  "Cost and Affordability" = "cost|costs|price|prices|cheap|expensive|affordable",
  "International Competition" = "china|chinese|america|american|india|indians",
  "Passenger Experience" = "seat|seats|seating|comfort|comfortable|luggage|space|trunk",
  "Vehicle Design" = "design|interior|doors|steering wheel|pedals",
  "Technology" = "lidar|radar|sensor|sensors|camera|cameras|software",
  "Urban Mobility" = "bus|buses|transit|traffic|congestion|transportation",
  "Accessibility" = "disabled|disability|wheelchair|elderly|accessibility",
  "Privacy" = "privacy|surveillance|tracking|monitoring|spying",
  "Journalism" = "reporting|bias|biased|lies"
)

theme_comments <- imap_dfr(keywords, function(pattern, theme) {
  comparison_comments |>
    filter(
      str_detect(
        text,
        regex(str_c("\\b(", pattern, ")\\b"), ignore_case = TRUE)
      )
    ) |>
    mutate(theme = theme)
})

theme_summary <- theme_comments |>
  group_by(video_group, theme) |>
  summarize(
    comments = n(),
    mean_sentiment = mean(net_sentiment),
    .groups = "drop"
  ) |>
  left_join(group_totals, by = "video_group") |>
  mutate(prevalence = comments / total_comments) |>
  filter(comments >= 10)


theme_colors <- c(
  "Zoox" = "#348c91",
  "Other Videos" = "#8275a8"
)

p1 <- theme_summary |>
  ggplot(aes(prevalence, theme, fill = video_group)) +
  geom_col(position = position_dodge(width = 0.8), width = 0.7) +
  scale_fill_manual(values = theme_colors) +
  scale_x_continuous(labels = scales::percent) +
  labs(
    title = "Theme Prevalence",
    x = "Proportion of Comments",
    y = NULL,
    fill = NULL
  ) +
  theme_minimal()

p2 <- theme_summary |>
  ggplot(aes(mean_sentiment, theme, color = video_group)) +
  geom_point(
    aes(size = comments),
    position = position_dodge(width = 0.5)
  ) +
  geom_vline(xintercept = 0, linetype = "dashed") +
  scale_color_manual(values = theme_colors) +
  scale_x_continuous(limits = c(-1, 1)) +
  labs(
    title = "Sentiment by Theme",
    x = "Mean Net Sentiment",
    y = NULL,
    color = NULL,
    size = "Comments"
  ) +
  theme_minimal()

ggarrange(
  p1, p2,
  ncol = 2,
  common.legend = TRUE,
  legend = "bottom"
)

The Zoox discussion exhibits a greater prevalence of themes related to urban mobility, passenger experience, safety, and vehicle design. The other videos have more discussion surrounding international competition, cost and affordability, technology, and journalism.

The mean net sentiment associated with these themes also varies considerably between the two groups. Comments mentioning urban mobility, vehicle design, and employment exhibit more favorable average sentiment in the Zoox discussion. Meanwhile, international competition, employment, and journalism are associated with negative sentiment in the other videos. Cost and affordability are a shared concern, with negative mean sentiment across both groups.

Finally, I conducted one-sample t-tests to determine whether the mean sentiment associated with each theme differed significantly from zero within each video group. The Holm correction was applied to account for multiple hypothesis testing:

theme_sentiment_tests <- theme_comments |>
  group_by(video_group, theme) |>
  filter(n() >= 10) |>
  group_modify(~ {
    result <- t.test(.x$net_sentiment, mu = 0)

    tibble(
      comments = nrow(.x),
      mean_sentiment = mean(.x$net_sentiment),
      lower_ci = result$conf.int[1],
      upper_ci = result$conf.int[2],
      t_statistic = as.numeric(result$statistic),
      p_value = result$p.value
    )
  }) |>
  ungroup() |>
  mutate(
    adjusted_p = p.adjust(p_value, method = "holm"),
    result = case_when(
      adjusted_p < 0.05 & mean_sentiment > 0 ~ "Positive",
      adjusted_p < 0.05 & mean_sentiment < 0 ~ "Negative",
      TRUE ~ "Not Significant"
    ),
    video_group = factor(
      video_group,
      levels = c("Zoox", "Other Videos")
    )
  ) |>
  arrange(theme, video_group)

theme_sentiment_tests |>
  select(theme, video_group, comments, mean_sentiment,
         lower_ci, upper_ci, adjusted_p, result) |>
  kable(
    digits = 4,
    col.names = c(
      "Theme", "Video Group", "Comments", "Mean Sentiment",
      "Lower CI", "Upper CI", "Adjusted p", "Result"
    ),
    caption = "One-Sample Sentiment Tests by Theme and Video Group"
  ) |>
  kable_styling(
    bootstrap_options = c("striped", "condensed"),
    full_width = FALSE
  ) |>
  collapse_rows(columns = 1, valign = "middle")
One-Sample Sentiment Tests by Theme and Video Group
Theme Video Group Comments Mean Sentiment Lower CI Upper CI Adjusted p Result
Cost and Affordability Zoox 26 -0.2861 -0.4649 -0.1072 0.0383 Negative
Other Videos 74 -0.2547 -0.3824 -0.1271 0.0023 Negative
Employment Zoox 12 0.1047 -0.3114 0.5207 1.0000 Not Significant
Other Videos 28 -0.5429 -0.6896 -0.3961 0.0000 Negative
International Competition Zoox 10 0.0874 -0.3176 0.4925 1.0000 Not Significant
Other Videos 92 -0.2448 -0.3364 -0.1531 0.0000 Negative
Journalism Other Videos 22 -0.5770 -0.7553 -0.3987 0.0000 Negative
Passenger Experience Zoox 33 -0.0501 -0.2673 0.1672 1.0000 Not Significant
Other Videos 20 -0.1917 -0.4623 0.0789 1.0000 Not Significant
Safety Zoox 36 -0.1558 -0.3447 0.0330 0.9243 Not Significant
Other Videos 43 -0.2374 -0.3964 -0.0784 0.0519 Not Significant
Technology Zoox 15 -0.0857 -0.4434 0.2721 1.0000 Not Significant
Other Videos 48 -0.2226 -0.3719 -0.0733 0.0519 Not Significant
Urban Mobility Zoox 36 0.1044 -0.0976 0.3065 1.0000 Not Significant
Other Videos 31 -0.3113 -0.5254 -0.0972 0.0582 Not Significant
Vehicle Design Zoox 29 0.0999 -0.1565 0.3563 1.0000 Not Significant
Other Videos 32 -0.1389 -0.3408 0.0631 1.0000 Not Significant
# Disclosure: I used AI to finalize the visual output/organization of this plot.

theme_sentiment_tests |>
  mutate(
    video_group = factor(video_group, levels = c("Zoox", "Other Videos")),
    result = factor(result, levels = c("Negative", "Not Significant", "Positive"))
  ) |>
  ggplot(aes(
    x = mean_sentiment,
    y = theme,
    group = video_group
  )) +
  geom_vline(
    xintercept = 0,
    linetype = "dashed",
    color = "grey40",
    linewidth = 0.6
  ) +
  geom_errorbar(
    aes(
      xmin = lower_ci,
      xmax = upper_ci,
      color = video_group,
      linetype = result,
      alpha = result
    ),
    orientation = "y",
    position = position_dodge(width = 0.6, orientation = "y"),
    width = 0.14,
    linewidth = 0.85
  ) +
  geom_point(
    aes(
      color = video_group,
      size = comments,
      alpha = result
    ),
    shape = 16,
    position = position_dodge(width = 0.6, orientation = "y")
  ) +
  scale_color_manual(values = c(
    "Zoox" = "#2c7fb8",
    "Other Videos" = "#d95f0e"
  )) +
  scale_linetype_manual(values = c(
    "Negative" = "solid",
    "Not Significant" = "solid",
    "Positive" = "solid"
  )) +
  scale_alpha_manual(values = c(
    "Negative" = 1,
    "Not Significant" = 0.55,
    "Positive" = 1
  )) +
  scale_size_continuous(
    range = c(3, 7),
    breaks = c(25, 50, 75)
  ) +
  scale_x_continuous(
    breaks = seq(-1, 1, 0.25)
  ) +
  coord_cartesian(xlim = c(-1, 1)) +
  labs(
    title = "Sentiment Associated with Each Theme",
    subtitle = "Mean net sentiment with 95% confidence intervals",
    x = "Mean Net Sentiment",
    y = NULL,
    color = "Video Group",
    size = "Comments",
    alpha = NULL
  ) +
  guides(
    linetype = "none",
    alpha = guide_legend(order = 2, override.aes = list(size = 4)),
    color = guide_legend(order = 1, override.aes = list(size = 4, alpha = 1)),
    size = guide_legend(order = 3)
  ) +
  theme_minimal(base_size = 11) +
  theme(
    plot.title = element_text(face = "bold", size = 14),
    plot.subtitle = element_text(color = "grey35", size = 11),
    plot.caption = element_text(color = "grey40", size = 9, hjust = 0),
    panel.grid.minor = element_blank(),
    panel.grid.major.x = element_line(color = "grey90"),
    panel.grid.major.y = element_line(color = "grey93"),
    axis.text.y = element_text(color = "grey20"),
    legend.position = "bottom",
    legend.box = "vertical",
    legend.title = element_text(face = "bold"),
    legend.spacing.y = unit(0.1, "cm")
  )

Cost and affordability is the only theme associated with significantly negative sentiment across both groups, suggesting a shared economic concern. Employment, international competition, and journalism are associated with significantly negative sentiment in the non-Zoox videos. The videos seem to be criticized by right-leaning Elon Musk fans defending Tesla, which may explain the negative sentiment reflected in the data.

Urban mobility and vehicle design exhibit positive mean sentiment in the Zoox discussion, but these results are not statistically significant. None of the themes exhibit statistically significant positive sentiment in the data in terms of both regular p-values and adjusted p-values.

There also seems to be definite concerns over loss of jobs to international competition, with particularly negative attitudes towards China and India.

Conclusion

Prevailing Sentiment

The analysis of 1,340 YouTube comments suggests that sentiment toward autonomous ride-hailing services in American cities is mixed but generally leans negative. While neutral sentiment constitutes the largest category (40.9%), negative sentiment (35.3%) considerably outweighs positive sentiment (23.8%). However, these attitudes vary across the contexts in which autonomous cabs are discussed. The Zoox Launch video exhibits significantly more favorable sentiment than the Waymo Ojai and Robotaxi Industry videos. Meanwhile, neither comment engagement nor temporal variation exhibits a statistically significant association with sentiment. There is also negative sentiment towards international competition.

Factors Associated with Sentiment

The vocabulary and thematic analyses show several factors associated with the observed sentiment. Cost and affordability are a shared concern, as it is the only theme associated with statistically significant negative mean sentiment across both video groups. Employment, international competition, and journalism are also associated with significantly negative sentiment in the non-Zoox videos.

The relatively positive sentiments towards Zoox seems to stem more from technology and design feature, such as passenger experience, urban mobility, and vehicle design, rather than transportation or customer experience. None of these examined themes are statistically significant. This suggests that the more favorable reception of Zoox may be characterized by less negative discourse rather than universa; enthusiasm.

Implications for Urban Transportation

The findings suggest that public acceptance of autonomous ride-hailing services is mixed, but most evidence leans towards a negative perception. Economic accessibility, employment implications, international competition, and the practical benefits of these services seem to drive negative attitudes.

Limitations

YouTube comments are a self-selected sample and far from a good approximation of the American urban population. I tried collecting a random sample from neutral videos, but it is evident from the data that responses carry some bias. The sentiment model has limitations in interpreting sarcasm, mixed opinions, and the target of criticism, while keyword-based thematic classification may overlook contextual details.

Overall, the discourse surrounding autonomous ride-hailing is a combination of technological optimism and socioeconomic skepticism.