R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

Note: this analysis was performed using the open source software R and RStudio.

Objective

The objective of this analysis is to explain how bivariate and multivariate regression work, using survey data our team collected about Nike social media engagement and purchase intention. This kind of analysis can help marketers make decisions about content strategy, brand engagement, and promotional campaigns.

Bivariate analysis is one of the simplest forms of statistical analysis. It is generally used to find out if there is a relationship between two sets of values (or two variables), usually involving \(X\) and \(Y\) (statisticshowto.com).

Dataset - our team’s Qualtrics Nike social media survey

The raw Qualtrics export (Nike Social Media Engagement_December 1, 2026_00.28.csv) had 22 rows (2 metadata header rows and 20 completed responses)[cite: 1]. We cleaned it in R by:

Variables used in this analysis:

library(readr)
library(dplyr)

# Read column names from row 1, then skip the 2 extra Qualtrics header rows
file_path <- "Nike Social Media Engagement_December 1, 2026_00.28.csv"
col_names <- names(read_csv(file_path, n_max = 0))
raw_survey <- read_csv(file_path, skip = 3, col_names = col_names)

# Clean and recode text responses to numeric scales (1 to 5)
nike_clean <- raw_survey %>%
  filter(Finished == TRUE) %>%
  transmute(
    Interact_freq = recode(Q2,
      "Strongly Disagree" = 1,
      "Somewhat disagree" = 2,
      "Neither agree nor disagree" = 3,
      "Somewhat agree" = 4,
      "Strongly agree" = 5
    ),
    Captures_attn = recode(Q3,
      "highly disagree" = 1,
      "diagree" = 2,
      "Neither agree nor disagree" = 3,
      "somwhate agree" = 4,
      "agree" = 5
    ),
    Regular_view = recode(Q4,
      "highly diagree" = 1,
      "disagree" = 2,
      "somewhat" = 3,
      "agree" = 4,
      "highly agree" = 5
    ),
    Purchase_intent = recode(`Q6 Dependent`,
      "strongly disagree" = 1,
      "disagree" = 2,
      "somewhat" = 3,
      "agree" = 4,
      "strongly agree" = 5
    )
  )

# Preview cleaned dataset
glimpse(nike_clean)
## Rows: 20
## Columns: 4
## $ Interact_freq   <dbl> 4, 4, 4, 1, 3, 3, 3, 3, 4, 3, 1, 1, 4, 3, 3, 3, 5, 4, …
## $ Captures_attn   <dbl> 1, 4, 5, 2, 4, 2, 1, 4, 4, 2, 4, 4, 5, 1, 1, 4, 5, 1, …
## $ Regular_view    <dbl> 5, 4, 3, 1, 4, 2, 1, 2, 2, 2, 1, 2, 1, 3, 1, 4, 2, 1, …
## $ Purchase_intent <dbl> 2, 4, 4, 3, 3, 3, 4, 2, 2, 2, 2, 2, 3, 3, 2, 3, 2, 4, …

Exploratory Scatter Plots

# Relationship between purchase intention and social media interaction frequency
plot(Purchase_intent ~ Interact_freq, data = nike_clean, pch = 16,
     main = "Purchase Intention vs. Social Media Interaction",
     xlab = "Interaction Frequency (Q2)", ylab = "Purchase Intention (Q6)")
abline(lm(Purchase_intent ~ Interact_freq, data = nike_clean), col = "grey20")

# Relationship between purchase intention and the other two predictors
plot(Purchase_intent ~ Captures_attn, data = nike_clean, pch = 16,
     main = "Purchase Intention vs. Attention Capture",
     xlab = "Captures Attention (Q3)", ylab = "Purchase Intention (Q6)")
abline(lm(Purchase_intent ~ Captures_attn, data = nike_clean), col = "grey20")

plot(Purchase_intent ~ Regular_view, data = nike_clean, pch = 16,
     main = "Purchase Intention vs. Regular Viewing",
     xlab = "Regularly Views Content (Q4)", ylab = "Purchase Intention (Q6)")
abline(lm(Purchase_intent ~ Regular_view, data = nike_clean), col = "grey20")

Simple Linear Regression (One Predictor)

First, we run a bivariate regression testing whether interaction frequency (Interact_freq) predicts purchase intention (Purchase_intent):

# Simple linear regression (one predictor)
model <- lm(Purchase_intent ~ Interact_freq, data = nike_clean)
summary(model)
## 
## Call:
## lm(formula = Purchase_intent ~ Interact_freq, data = nike_clean)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -0.9295 -0.6879 -0.1275  0.3725  1.3121 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     2.3255     0.4934   4.713 0.000173 ***
## Interact_freq   0.1208     0.1481   0.816 0.425332    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.8085 on 18 degrees of freedom
## Multiple R-squared:  0.03565,    Adjusted R-squared:  -0.01793 
## F-statistic: 0.6654 on 1 and 18 DF,  p-value: 0.4253

Multivariate Linear Regression (Three Predictors)

Next, we expand the model to include attention capture (Captures_attn) and regular content viewing (Regular_view) alongside interaction frequency:

# Multivariate linear regression (three predictors)
model_mult <- lm(Purchase_intent ~ Interact_freq + Captures_attn + Regular_view, 
                 data = nike_clean)
model_mult
## 
## Call:
## lm(formula = Purchase_intent ~ Interact_freq + Captures_attn + 
##     Regular_view, data = nike_clean)
## 
## Coefficients:
##   (Intercept)  Interact_freq  Captures_attn   Regular_view  
##       2.24028        0.11076       -0.00116        0.05437
summary(model_mult)
## 
## Call:
## lm(formula = Purchase_intent ~ Interact_freq + Captures_attn + 
##     Regular_view, data = nike_clean)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.95401 -0.67724 -0.09308  0.38999  1.37423 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)   
## (Intercept)    2.24028    0.63368   3.535  0.00275 **
## Interact_freq  0.11076    0.15999   0.692  0.49869   
## Captures_attn -0.00116    0.12427  -0.009  0.99267   
## Regular_view   0.05437    0.16320   0.333  0.74335   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.8545 on 16 degrees of freedom
## Multiple R-squared:  0.04241,    Adjusted R-squared:  -0.1371 
## F-statistic: 0.2362 on 3 and 16 DF,  p-value: 0.8698

References