Rationale

First‑level agenda‑setting theory argues that topics mentioned often in news can become important in people’s minds. When newsrooms have limited space and time, editors must decide which issues to feature and which to set aside. Topics end up competing for space on the media agenda. Some dominate coverage while others fade. This analysis asks how APNews.com allocated attention between U.S. economic conditions and climate change from January through September 2025.

Hypothesis

Weekly APNews.com coverage of the U.S. economy will differ from coverage of climate change between Jan. 1 and Sept. 30, 2025. I expect more stories about the economy than about climate change each week.

Variables & method

I used APNews.com stories published between Jan. 1 and Sept. 30, 2025. For each story I identified whether it concerned the economy or climate by searching its full text for key phrases. The dependent variable is the weekly number of stories, and the independent variable is topic (Economy vs Climate). I grouped stories by calendar week (weeks start on Monday) and counted the number of economy and climate stories each week. Because each week yields a pair of counts, a paired‑samples t‑test is appropriate for testing whether the average difference between the two counts is zero. I also compute Cohen’s dz as an effect size and present a histogram of the differences.

Results & discussion

Paired‑samples t‑test results and descriptive statistics
Metric Value
Mean economy 8.55e+00
SD economy 4.61e+00
Mean climate 5.00e+00
SD climate 3.02e+00
Mean difference 3.55e+00
SD difference 5.79e+00
t statistic 3.88e+00
df 3.90e+01
p‑value 3.91e-04
Cohen’s dz 6.10e-01

The paired‑samples t‑test returned a t‑statistic of 3.88 with 39 degrees of freedom and a p‑value of 3.91^{-4}. This indicates that the average weekly difference between economy and climate coverage is statistically significant. The mean difference was 3.55 stories per week, and the effect size (Cohen’s dz) was 0.61, which is considered large. The histogram shows that most weekly differences are positive, supporting the hypothesis that APNews.com published more economy stories than climate stories during this period.

Code

Below is the full R script used for this analysis. It installs any missing packages, downloads the APNews dataset if necessary, flags stories by topic, aggregates counts, performs the paired‑samples t‑test and generates the plots and summary table.

## Load libraries
if (!require("tidyverse")) install.packages("tidyverse")
if (!require("lubridate")) install.packages("lubridate")
if (!require("plotly")) install.packages("plotly")
if (!require("broom")) install.packages("broom")
if (!require("knitr")) install.packages("knitr")

library(tidyverse)
library(lubridate)
library(plotly)
library(broom)
library(knitr)

## Download and read data
if (!file.exists("APNews.rds")) {
  download.file(
    "https://github.com/drkblake/Data/raw/refs/heads/main/APNews.rds",
    destfile = "APNews.rds",
    mode = "wb"
  )
}
APNews <- readRDS("APNews.rds")

## Identify date column and filter dates
date_candidates <- c("DateTime", "Date", "dateTime", "ScrapeDate",
                     "Scrape.Time", "Timestamp", "PubDate", "PubDateUTC")
date_col <- intersect(date_candidates, names(APNews))[1]
if (is.na(date_col)) stop("No date column found")
APNews <- APNews %>%
  mutate(DateVar = as.POSIXct(.data[[date_col]])) %>%
  filter(DateVar >= as.POSIXct("2025-01-01") &
         DateVar <= as.POSIXct("2025-09-30")) %>%
  mutate(Week = floor_date(DateVar, unit = "week", week_start = 1))

## Build patterns and flag stories
build_pattern <- function(phrases) {
  escaped <- str_replace_all(
    phrases,
    "([\\^$.|?*+()\\[\\]{}\\\\])",
    "\\\\\\1"
  )
  paste0("\\b", escaped, "\\b", collapse = "|")
}
economy_terms <- c("inflation", "unemployment", "interest rate",
                   "economic growth", "recession", "gdp")
climate_terms <- c("climate change", "global warming",
                   "carbon emissions", "greenhouse gas",
                   "sea-level rise")
economy_pattern <- build_pattern(economy_terms)
climate_pattern <- build_pattern(climate_terms)

APNews <- APNews %>%
  mutate(
    Economy_flag = str_detect(Full.Text, regex(economy_pattern, ignore_case = TRUE)),
    Climate_flag = str_detect(Full.Text, regex(climate_pattern, ignore_case = TRUE))
  )

## Aggregate weekly counts
weekly_counts <- APNews %>%
  group_by(Week) %>%
  summarise(Economy = sum(Economy_flag),
            Climate = sum(Climate_flag),
            .groups = "drop") %>%
  mutate(Difference = Economy - Climate)

## Paired t-test
t_res <- t.test(weekly_counts$Economy, weekly_counts$Climate, paired = TRUE)
t_res
## 
##  Paired t-test
## 
## data:  weekly_counts$Economy and weekly_counts$Climate
## t = 3.88, df = 39, p-value = 0.0003913
## alternative hypothesis: true mean difference is not equal to 0
## 95 percent confidence interval:
##  1.699359 5.400641
## sample estimates:
## mean difference 
##            3.55
## Effect size
dz <- mean(weekly_counts$Difference) / sd(weekly_counts$Difference)
dz
## [1] 0.6134875
## Plot weekly counts
plot_data <- weekly_counts %>%
  pivot_longer(cols = c(Economy, Climate), names_to = "Topic", values_to = "Count")
plot_ly(plot_data, x = ~Week, y = ~Count, color = ~Topic,
        type = "scatter", mode = "lines+markers")
## Histogram of differences
plot_ly(x = ~weekly_counts$Difference, type = "histogram")