Rationale

In framing theory, a media message consumer’s response – like an attitude, judgment or action – depends at least partly upon exposure to cues embedded in the media message. A cue prompts the message consumer to apply a particular interpretive frame to the message, and this frame application leads to the response.

Considering what the theory says, a cue embedded in an advertisement could influence consumer judgments about the product being advertised. Specifically, the physique of the actor in a fast-food sandwich ad might influence viewer estimates of whether the sandwich is “healthy” or “unhealthy.”

Hypothesis

The proportion of participants judging a sandwich as “healthy” will differ depending on the physique of the actor shown in an advertisement for the sandwich.

Variables & method

A total of 244 participants were randomly assigned to one of two groups. One group (n = 123) viewed an advertisement depicting a “buff” actor eating the sandwich, while the other group (n = 121) viewed an otherwise identical advertisement featuring an actor with a “dad bod.” After viewing their assigned advertisement, participants completed a questionnaire that included the item asking whether they considered the advertised sandwich to be “healthy” or “unhealthy.”

The dependent variable in the analysis was a categorical measure of whether subjects had judged the sandwich “healthy” or “unhealthy.” The independent variable was a measure - also categorical - indicating whether subjects had viewed the “buff” or “dad bod” version of the ad.

A chi-square test of independence was conducted to examine whether the association between actor physique and perceived healthiness of the sandwich was statistically significant.

Results & discussion

The graph and crosstabulation table below summarize the association between the dependent and independent variables. The chi-square results are shown as well.

Crosstabulation of DV by IV
Counts and (Column Percentages)
Buff Dad bod
Healthy 50 (40.7%) 33 (27.3%)
Unhealthy 73 (59.3%) 88 (72.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 4.286 1 0.038

The results supported the hypothesis. While majorities of both treatment groups considered the sandwich unhealthy, proportionally more participants among the “dad bod” ad viewers considered it so (72.7%) than among the “buff” ad viewers (59.3%). The chi-square test found the association to be statistically significant.

Code:

# ------------------------------
# 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("SandwichAd_x2test.csv")

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

# ------------------------------
# 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

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

# Read the data from the web
FetchedData <- read.csv("https://github.com/drkblake/Data/raw/refs/heads/main/Crosstab2x2.csv")
# Save the data on your computer
write.csv(FetchedData, "SandwichAd_x2test.csv", row.names=FALSE)
# remove the data from the environment
rm (FetchedData)