Elaboration likelihood model suggests that enduring attitude change depends upon time spent processing information-rich, high-quality persuasive arguments. In this experiment, the dependent variable, Favor_1, measures whether a research participant favored (1) or opposed (0) legalizing recreational marijuana, while the independent variable, Time, measures how many seconds the participant spent looking at information-rich, high-quality persuasive arguments in support of legalizing recreational marijuana use.
Based on ELM, I hypothesize the odds of supporting marijuana legalization will increase significantly as time spent reading supporting arguments increases.
In this analysis, the dependent variable is “Favor_1”, while the independent variable is “Time”. Because the dependent variable is categorical with two categories and the independent variable is continuous, logistic regression offers a suitable statistical test of the hypothesis.
The analysis found that the odds of favoring marijuana legalization rose significantly (z = 4.8, p < .05), supporting the hypothesis.
# Read the data from the web
FetchedData <- read.csv("https://drkblake.com/wp-content/uploads/2023/10/ELM.csv")
# Save the data on your computer
write.csv(FetchedData, "ELM.csv", row.names=FALSE)
# remove the data from the environment
rm (FetchedData)
# Installing required packages
if (!require("tidyverse"))
install.packages("tidyverse")
library(ggplot2)
# Read the data
mydata <- read.csv("ELM.csv") #Edit YOURFILENAME.csv
# Specify the DV and IV
mydata$DV <- mydata$Favor_1 #Edit YOURDVNAME
mydata$IV <- mydata$Time #Edit YOURIVNAME
# Look at the DV and IV
ggplot(mydata, aes(x = DV)) + geom_bar(color = "black", fill = "#1f78b4")
ggplot(mydata, aes(x = IV)) + geom_histogram(color = "black", fill = "#1f78b4")
# Logistic regression plot
ggplot(mydata, aes(x = IV,
y = DV))+
geom_jitter(height = .03,
alpha = .5) +
geom_smooth(method = "glm",
method.args = list(family = "binomial"),
se = FALSE,
color = "#1f78b4")
# Run the logistic regression and view the summary results
options(scipen = 999)
log.ed <- glm(DV ~ IV, data = mydata, family = "binomial")
summary(log.ed)
##
## Call:
## glm(formula = DV ~ IV, family = "binomial", data = mydata)
##
## Deviance Residuals:
## Min 1Q Median 3Q Max
## -1.8855 -0.7788 -0.3463 0.7561 2.2548
##
## Coefficients:
## Estimate Std. Error z value Pr(>|z|)
## (Intercept) -4.567169 0.920675 -4.961 0.000000702 ***
## IV 0.016209 0.003383 4.791 0.000001661 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## (Dispersion parameter for binomial family taken to be 1)
##
## Null deviance: 131.791 on 99 degrees of freedom
## Residual deviance: 94.123 on 98 degrees of freedom
## AIC: 98.123
##
## Number of Fisher Scoring iterations: 5
p <- .50
Inflection_point <- (log(p/(1-p))-coef(log.ed)[1])/coef(log.ed)[2]
Inflection_point
## (Intercept)
## 281.7672