Rationale and Theory

Postpartum depression and postpartum psychosis are two psychological conditions related to post-childbirth. These conditions peaked my interest because of following the media coverage, videos, and discussions of the Lindsay Clancy case. The case made me wonder how much attention news media pay to the postpartum conditions on a normal basis versus when it is apart of wide spread news, and whether the coverage of different conditions differs from each other.

The analysis is based on the agenda-setting theory, which states that media coverage of certain issue can affect the perception of its importance by the audience. Agenda-setting theory does not claim that news media determine the opinions of the audience about an issue. Instead, it deals with the influence of the media attention on the issue importance among the audience.

Applying agenda-setting theory, this analysis shares whether news coverage of postpartum depression and postpartum psychosis increased during the Lindsay Clancy trial compared with the weeks before the trial began. The trial brought more media attention to postpartum mental health, making it an opportunity to see whether a major news event coincided with increased coverage of these conditions. By comparing weekly story counts before and during the trial period, this analysis will explore how news attention to postpartum mental health changed over time.

Hypothesis

News coverage of postpartum depression and postpartum psychosis will increase during the Lindsay Clancy trial compared with the weeks before the trial began.

Variables and Method

The independent variable is the news topic, with two categories: postpartum depression and postpartum psychosis. The dependent variable is weekly news coverage volume, measured by the number of U.S. online news stories matching each search query.

I used Media Cloud to view story counts for the phrases “postpartum depression” and “postpartum psychosis” from May 3, 2026, through October 3, 2026. This date range includes weeks before the Lindsay Clancy trial began on July 20, 2026, the trial period, and the weeks following the ending of the trial on September 4, 2026.

The R script retrieved daily story counts and put them into weekly totals, with each week running from Sunday-Saturday. It then calculated summary statistics for each topic, including total stories, weekly minimum and maximum, median, mean, and standard deviation. An interactive line graph was created to visualize coverage patterns over time.

This analysis measures the volume of news stories matching each search query. It does not measure audience responses or establish that the trial caused changes in coverage. Because the queries search for specific phrases, some relevant stories may not be included, and individual stories may mention both conditions.

Results and Discussion

The initial results show that news coverage of both postpartum depression and postpartum psychosis varied throughout the study period. The weekly coverage graph includes noticeable increases in the number of stories mentioning both conditions, suggesting that media attention was not consistent across the weeks examined.

Postpartum psychosis had a higher total number of stories and a higher average weekly story count than postpartum depression. However, postpartum depression had a higher median weekly story count. This difference suggests that some unusually high-coverage weeks contributed to the higher average for postpartum psychosis.

The timing of the increases is important to consider in relation to the Lindsay Clancy trial. Agenda-setting theory suggests that the amount of attention news media give to an issue may influence the issue’s perceived importance. However, the graph alone cannot establish that the trial caused the increases in coverage. Other events and news coverage patterns may also have contributed.

Further examination of the weekly results is needed to determine how coverage before the trial compares with coverage during and after the trial. These initial findings provide a starting point for exploring how news attention to postpartum mental health changes around a major news event.

One possible interpretation of the increase in postpartum depression coverage is that the Lindsay Clancy trial brought broader attention to postpartum mental health, rather than focusing public and media discussion exclusively on postpartum psychosis. Although the case centered on postpartum psychosis, the surrounding conversation may have encouraged news coverage of postpartum mental health more generally, including postpartum depression. This interpretation is consistent with agenda-setting theory, which suggests that increased media attention to a major event can bring greater attention to related issues. However, the graph cannot establish whether the trial caused the increase or why coverage of postpartum depression rose. These possibilities would require further research to confirm.

Summary Statistics for Postpartum Mental Health News Coverage
topic Total_Stories Weekly_Minimum Weekly_Maximum Weekly_Median Weekly_Mean Weekly_SD
Postpartum Psychosis 2034 0 431 24.5 92.45 120.52
Postpartum Depression 1284 6 361 39.0 58.36 74.51

Paired-Samples t-Test

A paired-samples t-test was completed to compare the weekly news coverage of postpartum depression and postpartum psychosis from May 3- October 3, 2026. Postpartum depression was used as V1, and postpartum psychosis was used as V2.

The results showed that postpartum psychosis received an average of 92.45 stories per week, compared with 58.36 stories per week for postpartum depression. The average difference between the two topics was 34.09 stories per week, with a standard deviation of 97.54. This shows that postpartum psychosis got more weekly coverage on average, although the amount of coverage varied from week to week.

The Shapiro-Wilk normality test gave a p-value of 0.0034, showing not normal. Since the analysis included only 22 cases, this test was not met. Therefore, the Wilcoxon signed-rank test was used as an alternative to the paired-samples t-test.

Descriptive Statistics: Pair Differences
count mean sd min max
22.000 34.091 97.545 −128.000 341.000
Normality Test (Shapiro-Wilk)
statistic p.value method
0.8497 0.0034 Shapiro-Wilk normality test
If the P.VALUE is 0.05 or less, the number of pairs is fewer than 40, and the distribution of pair differences shows obvious non-normality or outliers, consider using the Wilcoxon Signed Rank Test results instead of the Paired-Samples t-Test results.
Paired-Samples t-Test
statistic parameter p.value conf.low conf.high method
1.6392 21 0.1161 −9.1581 77.3400 Paired t-test
Group Means and SDs (t-Test)
V1_Mean V2_Mean V1_SD V2_SD
58.364 92.455 74.510 120.515
Wilcoxon Signed Rank Test
statistic p.value method
95.5000 0.3220 Wilcoxon signed rank test with continuity correction
Group Means and SDs (Wilcoxon)
V1_Mean V2_Mean V1_SD V2_SD
58.364 92.455 74.510 120.515

Paired-Sample t-Test Results

The paired-samples t-test gave a t-value of 1.6392 and a p-value of 0.1161. Since the p-value was higher than 0.05, the difference in average weekly coverage was not statistically significant.

The Wilcoxon signed-rank test also showed a result that was not significant, with a t-value of 95.5000 and a p-value of 0.3220. This gives us more information, stating that the difference between weekly coverage of postpartum depression and postpartum psychosis was not statistically significant.

Discussion

Although postpartum psychosis received about 34 more stories per week on average than postpartum depression, the tests did not give enough evidence to say the difference was statistically significant. This suggests that the difference in average coverage could be because of a variation in weekly story counts rather than a difference in media attention.

These findings are relevant to agenda-setting theory because they show how media’s attention to similar mental health conditions can change throughout a major news event. The Lindsay Clancy trial may have brought increased attention to postpartum mental health, but the results do not show one condition consistently getting more attention than the other.

These findings should be considered with the limitations of the study, including the search terms used to find stories, the selected news sources, and the time period studied. These results give a starting point for understanding how news coverage of postpartum depression and postpartum psychosis are compared during May 3, 2026 - October 3, 2026.

Code

Note: The code below will download the (made-up) data used in the analysis.

############################################################
# STEP 1: Install and Load Required Packages
############################################################

required_packages <- c(
  "tidyverse",
  "httr2",
  "lubridate",
  "plotly",
  "knitr",
  "kableExtra"
)

for (pkg in required_packages) {
  if (!requireNamespace(pkg, quietly = TRUE)) {
    install.packages(pkg)
  }
}

library(tidyverse)
library(httr2)
library(lubridate)
library(plotly)
library(knitr)
library(kableExtra)

############################################################
# STEP 2: Verify Media Cloud API Key
############################################################

if (!nzchar(Sys.getenv("MEDIACLOUD_KEY"))) {
  stop(
    "No Media Cloud API key was found.\n",
    "Run the setup section once,\n",
    "then restart R and try again."
  )
}

mc_key <- Sys.getenv("MEDIACLOUD_KEY")

############################################################
# STEP 3: Define the Date Range
############################################################

start_date <- "2026-05-03"
end_date   <- "2026-10-03"

############################################################
# STEP 4: Define Search Queries
############################################################

depression_query <-
  '"postpartum depression"'

psychosis_query <-
  '"postpartum psychosis"'

############################################################
# STEP 5: Create Topic Definitions
############################################################

topics <- c(
  "Postpartum Depression" = depression_query,
  "Postpartum Psychosis" = psychosis_query
)

############################################################
# STEP 6: Create a Function to Retrieve Daily
# Story Counts
############################################################

mc_counts_over_time <- function(
    query,
    start_date,
    end_date,
    collection_id = 34412234
) {
  
  resp <-
    request(
      "https://search.mediacloud.org/api/search/count-over-time"
    ) |>
    req_headers(
      Authorization = paste("Token", mc_key)
    ) |>
    req_url_query(
      q = query,
      start = start_date,
      end = end_date,
      platform = "onlinenews-mediacloud",
      cs = collection_id
    ) |>
    req_perform()
  
  results <- resp |>
    resp_body_json()
  
  map_dfr(
    results$count_over_time$counts,
    as_tibble
  ) |>
    mutate(
      date = as.Date(date)
    )
}

############################################################
# STEP 7: Download Daily Counts for All Topics
############################################################

topic_data <-
  imap_dfr(
    topics,
    function(search_string, topic_name) {
      
      message(
        "Downloading: ",
        topic_name
      )
      
      results <-
        mc_counts_over_time(
          query = search_string,
          start_date = start_date,
          end_date = end_date
        )
      
      Sys.sleep(35)
      
      results |>
        mutate(
          topic = topic_name
        )
    }
  )

############################################################
# STEP 8: Examine the Downloaded Daily Data
############################################################

head(topic_data)

glimpse(topic_data)

############################################################
# STEP 9: Convert Daily Counts to Weekly Counts
############################################################

weekly_counts <-
  topic_data |>
  mutate(
    week = floor_date(
      date,
      unit = "week"
    )
  ) |>
  group_by(
    topic,
    week
  ) |>
  summarise(
    stories = sum(count),
    .groups = "drop"
  )

############################################################
# STEP 10: Examine Weekly Counts
############################################################

weekly_counts

############################################################
# STEP 11: Summarize Coverage by Topic
############################################################

topic_summary <-
  weekly_counts |>
  group_by(topic) |>
  summarise(
    Total_Stories = sum(stories),
    Weekly_Minimum = min(stories),
    Weekly_Maximum = max(stories),
    Weekly_Median = median(stories),
    Weekly_Mean = round(
      mean(stories),
      2
    ),
    Weekly_SD = round(
      sd(stories),
      2
    ),
    .groups = "drop"
  ) |>
  arrange(
    desc(Total_Stories)
  )

Table <-
  topic_summary |>
  kbl(
    caption =
      "Media Cloud Topic Summary Statistics",
    align = "lrrrrrr"
  ) |>
  kable_styling(
    full_width = FALSE,
    bootstrap_options = c(
      "striped",
      "hover",
      "condensed"
    )
  )

Table

############################################################
# STEP 12: Create an Interactive Plotly Graph
############################################################

weekly_counts <- weekly_counts |>
  mutate(
    stories_formatted = formatC(
      stories,
      format = "d",
      big.mark = ","
    )
  )

Graph <- plot_ly(
  data = weekly_counts,
  
  x = ~week,
  y = ~stories,
  
  color = ~topic,
  colors = "Set1",
  
  type = "scatter",
  mode = "lines+markers",
  
  customdata = ~topic,
  
  text = ~stories_formatted,
  
  hovertemplate =
    paste(
      "%{customdata}
",
      "Week: %{x|%Y-%m-%d}
",
      "Stories: %{text}
",
      ""
    )
) |>
  layout(
    title =
      "Weekly U.S. Coverage Volume",
    
    hovermode = "x unified",
    
    xaxis = list(
      title = "Week"
    ),
    
    yaxis = list(
      title = "Weekly Story Count",
      separatethousands = TRUE
    )
  )

Graph

############################################################ 
# Reshape the data
############################################################ 

weekly_counts_wide <-
  weekly_counts %>%
  mutate(
    topic = make.names(topic)
  ) %>%
  select(week, topic, stories) %>%
  pivot_wider(
    names_from  = topic,
    values_from = stories
  )

# ============================================================
#  Paired-samples t-test code
# 
#  Setup: Install and Load Required Packages
# ============================================================
if (!require("tidyverse")) install.packages("tidyverse")
if (!require("plotly")) install.packages("plotly")
if (!require("gt")) install.packages("gt")
if (!require("gtExtras")) install.packages("gtExtras")
if (!require("broom")) install.packages("broom")

library(tidyverse)
library(plotly)
library(gt)
library(gtExtras)
library(broom)

options(scipen = 999)

# ============================================================
#  Data Import
# ============================================================
mydata <- weekly_counts_wide

# Specify the two variables involved
mydata$V1 <- mydata$Postpartum.Depression
mydata$V2 <- mydata$Postpartum.Psychosis

# ============================================================
#  Compute Pair Differences
# ============================================================
mydata$PairDifferences <- mydata$V2 - mydata$V1

# ============================================================
#  Interactive Histogram of Pair Differences
# ============================================================
hist_plot <- plot_ly(
  data = mydata,
  x = ~PairDifferences,
  type = "histogram",
  marker = list(color = "#1f78b4", line = list(color = "black", width = 1))
) %>%
  layout(
    title = "Distribution of Pair Differences",
    xaxis = list(title = "Pair Differences"),
    yaxis = list(title = "Count"),
    shapes = list(
      list(
        type = "line",
        x0 = mean(mydata$PairDifferences, na.rm = TRUE),
        x1 = mean(mydata$PairDifferences, na.rm = TRUE),
        y0 = 0,
        y1 = max(table(mydata$PairDifferences)),
        line = list(color = "red", dash = "dash")
      )
    )
  )

# ============================================================
#  Descriptive Statistics
# ============================================================
desc_stats <- mydata %>%
  summarise(
    count = n(),
    mean = mean(PairDifferences, na.rm = TRUE),
    sd = sd(PairDifferences, na.rm = TRUE),
    min = min(PairDifferences, na.rm = TRUE),
    max = max(PairDifferences, na.rm = TRUE)
  )

desc_table <- desc_stats %>%
  gt() %>%
  gt_theme_538() %>%
  tab_header(title = "Descriptive Statistics: Pair Differences") %>%
  fmt_number(columns = where(is.numeric), decimals = 3)

# ============================================================
#  Normality Test (Shapiro-Wilk)
# ============================================================
shapiro_res <- shapiro.test(mydata$PairDifferences)
shapiro_table <- tidy(shapiro_res) %>%
  select(statistic, p.value, method) %>%
  gt() %>%
  gt_theme_538() %>%
  tab_header(title = "Normality Test (Shapiro-Wilk)") %>%
  fmt_number(columns = c(statistic, p.value), decimals = 4) %>%
  tab_source_note(
    source_note = "If the P.VALUE is 0.05 or less, the number of pairs is fewer than 40, and the distribution of pair differences shows obvious non-normality or outliers, consider using the Wilcoxon Signed Rank Test results instead of the Paired-Samples t-Test results."
  )

# ============================================================
#  Reshape Data for Repeated-Measures Plot
# ============================================================
df_long <- mydata %>%
  pivot_longer(cols = c(V1, V2),
               names_to = "Measure",
               values_to = "Value")

# ============================================================
#  Repeated-Measures Boxplot (Interactive, with Means)
# ============================================================
group_means <- df_long %>%
  group_by(Measure) %>%
  summarise(mean_value = mean(Value), .groups = "drop")

boxplot_measures <- plot_ly() %>%
  add_trace(
    data = df_long,
    x = ~Measure, y = ~Value,
    type = "box",
    boxpoints = "outliers",   
    marker = list(color = "red", size = 4),
    line = list(color = "black"),
    fillcolor = "royalblue",
    name = ""
  ) %>%
  add_trace(
    data = group_means,
    x = ~Measure, y = ~mean_value,
    type = "scatter", mode = "markers",
    marker = list(
      symbol = "diamond", size = 9,
      color = "black", line = list(color = "white", width = 1)
    ),
    text = ~paste0("Mean = ", round(mean_value, 2)),
    hoverinfo = "text",
    name = "Group Mean"
  ) %>%
  layout(
    title = "Boxplot of Repeated Measures (V1 vs V2) with Means",
    xaxis = list(title = "Measure"),
    yaxis = list(title = "Value"),
    showlegend = FALSE
  )

# ============================================================
#  Parametric Test (Paired-Samples t-Test)
# ============================================================
t_res <- t.test(mydata$V2, mydata$V1, paired = TRUE)
t_table <- tidy(t_res) %>%
  select(statistic, parameter, p.value, conf.low, conf.high, method) %>%
  gt() %>%
  gt_theme_538() %>%
  tab_header(title = "Paired-Samples t-Test") %>%
  fmt_number(columns = c(statistic, p.value, conf.low, conf.high), decimals = 4)

t_summary <- mydata %>%
  select(V1, V2) %>%
  summarise_all(list(Mean = mean, SD = sd)) %>%
  gt() %>%
  gt_theme_538() %>%
  tab_header(title = "Group Means and SDs (t-Test)") %>%
  fmt_number(columns = everything(), decimals = 3)

# ============================================================
#  Nonparametric Test (Wilcoxon Signed Rank)
# ============================================================
wilcox_res <- wilcox.test(mydata$V1, mydata$V2, paired = TRUE,
                          exact = FALSE)
wilcox_table <- tidy(wilcox_res) %>%
  select(statistic, p.value, method) %>%
  gt() %>%
  gt_theme_538() %>%
  tab_header(title = "Wilcoxon Signed Rank Test") %>%
  fmt_number(columns = c(statistic, p.value), decimals = 4)

wilcox_summary <- mydata %>%
  select(V1, V2) %>%
  summarise_all(list(Mean = mean, SD = sd)) %>%
  gt() %>%
  gt_theme_538() %>%
  tab_header(title = "Group Means and SDs (Wilcoxon)") %>%
  fmt_number(columns = everything(), decimals = 3)

# ============================================================
#  Results Summary (in specified order)
# ============================================================
hist_plot
desc_table
shapiro_table
boxplot_measures
t_table
t_summary
wilcox_table
wilcox_summary