Rationale

Agenda-setting theory says the media doesn’t tell us what to think, but what to think about and how to think. To summarize journalist Walter Lipman, public opinion is a response to the “pseudo-environment” rather than the world outside. Reality is a curated thing for most people and media are part of constructing a perception that fulfills whatever agenda they have.

The first level of agenda-setting is how topics constantly compete for salience in media (what to think about). In second-level agenda-setting, different topic attributes compete and media often direct public attention toward those (how to think). The third level is network agenda-setting, where media group certain topics together, creating an association.

There’s only so much space for competing topics. So viewers’ opinions are often shaped by what they are spoon fed by media that they read or watch, creating what could be considered an illusion as referenced by Lipman. The same incident can be crafted to set (and suit) an agenda, whether intentional (most often) or not.

The data represents 600 Fox News or CNN viewers pulled for a larger national survey conducted in September 2023.

Hypothesis

For the test, the Fox News (300) and CNN (300) viewers were asked to focus on the subject of immigration and whether they considered it a top issue or not a top issue. I believe Fox News viewers will overwhelmingly choose immigration as a top issue versus CNN viewers, who will likely not view it as a top issue.

Variables & method

The dependent variable (DV) in the chi-square analysis was whether participants considered immigration a significant issue. The independent variable (IV) showed viewers’ preferred network. Their responses were compared across two network preference groups using a chi-square test.

Results & discussion

The graph, crosstabulation table and chi-square test offer a visual summary of the findings.

CNN viewers in this survey do not, in fact, consider immigration a top issue. More of the Fox News viewers in this survey do view immigration as a significant issue, but the difference was less drastic than I assumed.

Out of 300 CNN viewers surveyed, only 35 (11.7%) said immigration is a top issue and 265 (88.3%) did not consider immigration a top issue.

In comparison, there were 115 (38.3%) Fox News viewers who consider immigration a top issue versus 185 (61.7%) who said immigration was not a top issue. I assumed the percentages would be switched, that 61% would think immigration is a top issue and 38% would think it was not a top issue.

A chi-squared test of independence between DV and IV showed the association between the variables is highly unlikely to be random, showing the p-value at 0.

Crosstabulation of DV by IV
Counts and (Column Percentages)
CNN Fox
1 Top issue 35 (11.7%) 115 (38.3%)
2 Not top issue 265 (88.3%) 185 (61.7%)
Chi-squared Test Results
Test of Independence between DV and IV
Test Chi-squared Statistic Degrees of Freedom p-value
Chi-squared Test of Independence 55.476 1 0.000

Code

Here is the R script used to produce the results.

# ------------------------------
# Setup: Install and load packages
# ------------------------------
if (!require("tidyverse")) install.packages("tidyverse")   # Data wrangling & plotting
if (!require("gmodels")) install.packages("gmodels")       # Crosstabs
if (!require("gt")) install.packages("gt")                 # Table formatting

library(tidyverse)
library(gmodels)
library(gt)

# ------------------------------
# Load the data
# ------------------------------
# Replace "YOURFILENAME.csv" with your dataset name
mydata <- read.csv("TopIssue.csv") #Edit

# ------------------------------
# Define Dependent (DV) and Independent (IV) variables
# ------------------------------
# Replace YOURDVNAME and YOURIVNAME with actual column names in your data
mydata$DV <- mydata$Immigration #Edit
mydata$IV <- mydata$PreferredNetwork #Edit

# ------------------------------
# Visualization: Stacked bar chart of IV by DV
# ------------------------------
graph <- ggplot(mydata, aes(x = IV, fill = DV)) +
  geom_bar(colour = "black") +
  scale_fill_brewer(palette = "Paired") +
  labs(
    title = "Distribution of DV by IV",
    x = "Independent Variable",
    y = "Count",
    fill = "Dependent Variable"
  )

#Show the graph
graph

# ------------------------------
# Crosstabulation of DV by IV (DV = rows, IV = columns)
# ------------------------------

crosstab <- mydata %>%
  count(DV, IV) %>%
  group_by(IV) %>%
  mutate(RowPct = 100 * n / sum(n)) %>%
  ungroup() %>%
  mutate(Cell = paste0(n, "\n(", round(RowPct, 1), "%)")) %>%
  select(DV, IV, Cell) %>%
  pivot_wider(names_from = IV, values_from = Cell)

# Format into gt table
crosstab_table <- crosstab %>%
  gt(rowname_col = "DV") %>%
  tab_header(
    title = "Crosstabulation of DV by IV",
    subtitle = "Counts and (Column Percentages)"
  ) %>%
  cols_label(
    DV = "Dependent Variable"
  )

# Show the polished crosstab table
crosstab_table

# ------------------------------
# Chi-squared test of independence
# ------------------------------
options(scipen = 999)  # Prevents scientific notation
chitestresults <- chisq.test(mydata$DV, mydata$IV)

# ------------------------------
# Format Chi-squared test results into a table
# ------------------------------
chitest_summary <- tibble(
  Test   = "Chi-squared Test of Independence",
  Chi_sq = chitestresults$statistic,
  df     = chitestresults$parameter,
  p      = chitestresults$p.value
)

chitest_table <- chitest_summary %>%
  gt() %>%
  # Round χ² and p-value to 3 decimals, df to integer
  fmt_number(columns = c(Chi_sq, p), decimals = 3) %>%
  fmt_number(columns = df, decimals = 0) %>%
  tab_header(
    title = "Chi-squared Test Results",
    subtitle = "Test of Independence between DV and IV"
  ) %>%
  cols_label(
    Test   = "Test",
    Chi_sq = "Chi-squared Statistic",
    df     = "Degrees of Freedom",
    p      = "p-value"
  )

# Show the formatted results table
chitest_table