Agenda-setting theory proposes that issues emphasized in news coverage can become more prominent in audiences’ perceptions of what matters. Drawing on the competition for attention rationale, this project examines whether military news coincides with reduced prominence of economic concerns on the media agenda. During this time period the lagging economy was a top of mind subject for the United States and I wanted to see if large scale military actions taken would fuel more attention on the economy or detract from its coverage. The analysis focuses on the January 3, 2026, U.S. military operation that captured Nicolas Maduro in Venezuela and the beginning of the U.S. and Israeli military campaign against Iran on February 28, 2026. It compares coverage of these topics with coverage of U.S. inflation, consumer prices, employment, and cost of living concerns.
Average weekly coverage of U.S. economic concerns will be lower during the four weeks beginning with each military event than during the preceding four weeks.
The independent variable is the time period relative to each military event, either four weeks before or four weeks after. The two events are the January 3, 2026, Venezuela operation and the February 28, 2026, beginning of the Iran war. The dependent variable is the amount of news coverage devoted to U.S. economic concerns. It is measured by the number of relevant stories published each week and those stories percentage of all news stories in that collection. Data will be retrieved from Media Cloud’s United States–National collection for December 6, 2025, through March 27, 2026. Weeks run Saturday through Friday, allowing each military event to begin an after-event week. Keyword searches will identify coverage of military actions and economic concerns, including inflation, consumer prices, unemployment, and the cost of living. Sample matching articles will be reviewed to check their relevance.
Dotted lines mark January 3, 2026, and February 28, 2026. Each point represents a complete Saturday–Friday week.
| topic | Total_Stories | Weekly_Minimum | Weekly_Maximum | Weekly_Median | Weekly_Mean | Weekly_SD | Mean_Weekly_Share_Pct |
|---|---|---|---|---|---|---|---|
| Iran military coverage | 49230 | 284 | 11882 | 1173.0 | 3076.88 | 3740.69 | 4.329 |
| U.S. economic concerns | 29614 | 1029 | 2986 | 1633.5 | 1850.88 | 574.74 | 2.661 |
| Venezuela military coverage | 24802 | 590 | 7507 | 1029.5 | 1550.12 | 1707.00 | 2.198 |
Each comparison includes four weeks before the event and four weeks beginning on the event date. A negative change indicates lower coverage after the event. Changes in coverage shares are expressed in percentage points.
| Event | Before: stories/week | After: stories/week | Story change | Before: share (%) | After: share (%) | Share change (points) |
|---|---|---|---|---|---|---|
| Venezuela operation | 1661.25 | 1696.75 | 35.5 | 2.572 | 2.351 | -0.221 |
| Start of 2026 Iran war | 1447.50 | 2598.00 | 1150.5 | 2.083 | 3.636 | 1.553 |
The initial results do not support my hypothesis that economic coverage would decline following major military actions and detract from the publics prominent concern. Although Venezuela military coverage peaked at approximately 10% of news stories during the operation’s opening week, average weekly economic coverage increased slightly, from 1,661 to 1,696 stories. Its share of total coverage decreased from 2.572% to 2.351%, indicating reduced relative prominence but not substantially fewer stories. Iran military coverage reached approximately 16% during the war’s opening week, while economic coverage also increased. Average weekly economic stories rose from 1,447.50 to 2,598.00, and their share increased from 2.083% to 3.636%. Military developments may have stoked economic concerns about gasoline prices, inflation, and other economic concerns. Viewed through agenda-setting theory, these findings suggest that increased military coverage does not necessarily displace economic news. Related issues may gain attention together.
Here is the code that produced the analysis:
if (!nzchar(Sys.getenv("MEDIACLOUD_KEY"))) {
stop(
"No MEDIACLOUD_KEY found. Complete your professor's ",
"API-key setup, restart R, and knit again."
)
}
mc_key <- Sys.getenv("MEDIACLOUD_KEY")
start_date <- as.Date("2025-12-06")
end_date <- as.Date("2026-03-27")
collection_id <- 34412234
events <- tibble(
Event = c("Venezuela operation", "Start of 2026 Iran war"),
Event_date = as.Date(c("2026-01-03", "2026-02-28"))
)
us_context <-
'("United States" OR "U.S." OR American OR Trump OR Pentagon)'
venezuela_query <- paste0(
'language:en AND ', us_context,
' AND (Venezuela OR Venezuelan OR Maduro)',
' AND (military OR strike* OR raid* OR attack*',
' OR captur* OR operation*)'
)
iran_query <- paste0(
'language:en AND ', us_context,
' AND (Iran OR Iranian)',
' AND (war OR military OR strike* OR attack*',
' OR bombing OR missile*)'
)
economy_query <- paste0(
'language:en AND ("United States" OR "U.S." OR American',
' OR Trump OR "Federal Reserve" OR "Bureau of Labor Statistics")',
' AND (inflation OR "cost of living" OR "consumer prices"',
' OR "gas prices" OR "gasoline prices" OR "food prices"',
' OR "grocery prices" OR unemployment OR "job market")'
)
topics <- c(
"Venezuela military coverage" = venezuela_query,
"Iran military coverage" = iran_query,
"U.S. economic concerns" = economy_query,
"All English-language news" = "language:en"
)
mc_counts_over_time <- function(
query, start_date, end_date,
collection_id = 34412234) {
response <- request(
"https://search.mediacloud.org/api/search/count-over-time"
) |>
req_headers(
Authorization = paste("Token", mc_key)
) |>
req_url_query(
q = query,
start = as.character(start_date),
end = as.character(end_date + 1),
platform = "onlinenews-mediacloud",
cs = collection_id
) |>
req_timeout(120) |>
req_retry(max_tries = 3) |>
req_perform()
results <- resp_body_json(response)
rows <- results$count_over_time$counts
if (is.null(rows) || length(rows) == 0) {
stop("No daily rows returned. Check the query and dates in Media Cloud.")
}
daily <- map_dfr(rows, as_tibble)
if (!all(c("date", "count") %in% names(daily))) {
stop("Unexpected API response: date and count columns were not found.")
}
# Filter locally to preserve the intended inclusive end date.
daily <- daily |>
transmute(
date = as.Date(date),
count = as.numeric(count)
) |>
filter(date >= start_date, date <= end_date) |>
arrange(date)
expected_dates <- seq(start_date, end_date, by = "day")
if (
anyNA(daily) ||
any(daily$count < 0) ||
anyDuplicated(daily$date) > 0 ||
!setequal(daily$date, expected_dates)
) {
stop(
"Missing, duplicate, or invalid daily data. ",
"Missing dates have not been converted to zero."
)
}
daily
}
topic_data <- imap_dfr(
topics,
function(search_string, topic_name) {
results <- mc_counts_over_time(
query = search_string,
start_date = start_date,
end_date = end_date,
collection_id = collection_id
)
# Pause between API calls, following the course example.
Sys.sleep(35)
results |>
mutate(topic = topic_name)
}
)
daily_totals <- topic_data |>
filter(topic == "All English-language news") |>
select(date, total_news = count)
daily_topics <- topic_data |>
filter(topic != "All English-language news") |>
left_join(daily_totals, by = "date")
if (
any(daily_topics$total_news <= 0) ||
any(daily_topics$count > daily_topics$total_news)
) {
stop("Inconsistent total-news counts. Inspect the retrieved data.")
}
weekly_counts <- daily_topics |>
mutate(
week = floor_date(date, unit = "week", week_start = 6)
) |>
group_by(topic, week) |>
summarise(
stories = sum(count),
total_news = sum(total_news),
days_observed = n(),
.groups = "drop"
) |>
mutate(
share_pct = 100 * stories / total_news
)
stopifnot(all(weekly_counts$days_observed == 7))
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),
Mean_Weekly_Share_Pct = round(mean(share_pct), 3),
.groups = "drop"
) |>
arrange(desc(Total_Stories))
event_lines <- lapply(
as.character(events$Event_date),
function(d) {
list(
type = "line",
xref = "x", yref = "paper",
x0 = d, x1 = d,
y0 = 0, y1 = 1,
line = list(color = "gray", dash = "dot")
)
}
)
Graph <- plot_ly(
weekly_counts,
x = ~week,
y = ~stories,
color = ~topic,
colors = "Set1",
type = "scatter",
mode = "lines+markers",
customdata = ~topic,
hovertemplate = paste0(
"%{customdata}<br>",
"Week starting: %{x|%Y-%m-%d}<br>",
"Stories: %{y:,.0f}<extra></extra>"
)
) |>
layout(
title = "Weekly Military and Economic News Coverage",
hovermode = "x unified",
shapes = event_lines,
xaxis = list(title = "Week starting Saturday"),
yaxis = list(
title = "Weekly story count",
separatethousands = TRUE
),
legend = list(orientation = "h", y = -0.3),
margin = list(b = 130)
)
Graph
Table <- topic_summary |>
kbl(
caption = "Weekly Coverage Summary Statistics"
) |>
kable_styling(
full_width = FALSE,
bootstrap_options = c("striped", "hover", "condensed")
) |>
scroll_box(width = "100%")
Table
ShareGraph <- plot_ly(
weekly_counts,
x = ~week,
y = ~share_pct,
color = ~topic,
colors = "Set1",
type = "scatter",
mode = "lines+markers",
customdata = ~topic,
hovertemplate = paste0(
"%{customdata}<br>",
"Week starting: %{x|%Y-%m-%d}<br>",
"Share of news: %{y:.2f}%<extra></extra>"
)
) |>
layout(
title = "Share of Total English-Language News Coverage",
hovermode = "x unified",
shapes = event_lines,
xaxis = list(title = "Week starting Saturday"),
yaxis = list(title = "Percent of all news stories"),
legend = list(orientation = "h", y = -0.3),
margin = list(b = 130)
)
ShareGraph
event_comparison <- map_dfr(
seq_len(nrow(events)),
function(i) {
event_date <- events$Event_date[i]
weekly_counts |>
filter(
week >= event_date - 28,
week < event_date + 28
) |>
mutate(
Period = if_else(week < event_date, "Before", "After")
) |>
group_by(topic, Period) |>
summarise(
Weeks = n(),
Mean_Weekly_Stories = mean(stories),
Mean_Weekly_Share = mean(share_pct),
.groups = "drop"
) |>
pivot_wider(
names_from = Period,
values_from = c(
Weeks,
Mean_Weekly_Stories,
Mean_Weekly_Share
)
) |>
mutate(
Event = events$Event[i],
Change_Stories =
Mean_Weekly_Stories_After - Mean_Weekly_Stories_Before,
Change_Share_PP =
Mean_Weekly_Share_After - Mean_Weekly_Share_Before,
.before = 1
)
}
)
stopifnot(
all(event_comparison$Weeks_Before == 4),
all(event_comparison$Weeks_After == 4)
)
economy_results <- event_comparison |>
filter(topic == "U.S. economic concerns") |>
select(
Event,
Mean_Weekly_Stories_Before,
Mean_Weekly_Stories_After,
Change_Stories,
Mean_Weekly_Share_Before,
Mean_Weekly_Share_After,
Change_Share_PP
)
EconomyTable <- economy_results |>
kbl(
digits = 3,
caption = "Economic Coverage Before and After Military Events",
col.names = c(
"Event",
"Before: stories/week",
"After: stories/week",
"Story change",
"Before: share (%)",
"After: share (%)",
"Share change (points)"
)
) |>
kable_styling(
full_width = FALSE,
bootstrap_options = c("striped", "hover", "condensed")
) |>
scroll_box(width = "100%")
EconomyTable
```