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