Load Libraries
library(psych)
## Warning: package 'psych' was built under R version 4.1.3
library(kableExtra)
## Warning: package 'kableExtra' was built under R version 4.1.3
library(ggplot2)
##
## Attaching package: 'ggplot2'
## The following objects are masked from 'package:psych':
##
## %+%, alpha
library(ggrepel)
library(tidyr)
library(dplyr)
##
## Attaching package: 'dplyr'
## The following object is masked from 'package:kableExtra':
##
## group_rows
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
# library(gtools)
library(nFactors)
## Loading required package: lattice
##
## Attaching package: 'nFactors'
## The following object is masked from 'package:lattice':
##
## parallel
library(corrplot)
## corrplot 0.92 loaded
library(afex)
## Loading required package: lme4
## Loading required package: Matrix
##
## Attaching package: 'Matrix'
## The following objects are masked from 'package:tidyr':
##
## expand, pack, unpack
## ************
## Welcome to afex. For support visit: http://afex.singmann.science/
## - Functions for ANOVAs: aov_car(), aov_ez(), and aov_4()
## - Methods for calculating p-values with mixed(): 'S', 'KR', 'LRT', and 'PB'
## - 'afex_aov' and 'mixed' objects can be passed to emmeans() for follow-up tests
## - NEWS: emmeans() for ANOVA models now uses model = 'multivariate' as default.
## - Get and set global package options with: afex_options()
## - Set orthogonal sum-to-zero contrasts globally: set_sum_contrasts()
## - For example analyses see: browseVignettes("afex")
## ************
##
## Attaching package: 'afex'
## The following object is masked from 'package:lme4':
##
## lmer
library(naniar)
## Warning: package 'naniar' was built under R version 4.1.3
library(stringr)
library(emmeans)
library(lavaan)
## This is lavaan 0.6-16
## lavaan is FREE software! Please report any bugs.
##
## Attaching package: 'lavaan'
## The following object is masked from 'package:psych':
##
## cor2cov
library(sjPlot)
##
## Attaching package: 'sjPlot'
## The following object is masked from 'package:ggplot2':
##
## set_theme
library(purrr)
library(DT)
library(svglite)
## Warning: package 'svglite' was built under R version 4.1.3
Load Data
df1 <- read.csv(file="data/Learning About Psychology (SONA)_August 22, 2025_20.13.csv", header=T, na.strings = c(""," "))
labels1 <- data.frame(t(cbind(df1[1,],samp="Sample Source")))
df1 <- df1[-c(1,2), ]
df1 <- subset(df1, Progress == "100", select=-c(4,14:15))
df1$samp <- "SONA"
df2 <- read.csv(file="data/Learning About Psychology (Prolific)_August 22, 2025_20.14.csv", header=T, na.strings = c(""," "))
labels2 <- data.frame(t(cbind(df2[1,],samp="Sample Source")))
df2 <- df2[-c(1,2), ]
# df2_quality <- subset(df2, select=c(8,173:175))
df2 <- subset(df2, Progress == "100" & Q1.1 == 2 & Q2 < 4, select=-c(4,14:15))
df2$id <- df2$ResponseId
df2$samp <- "Prolific"
common_cols <- intersect(names(df1), names(df2))
df <- bind_rows(
select(df1, all_of(common_cols)),
select(df2, all_of(common_cols))
)
flag <- labels1 %>%
filter(grepl("truthful", X1))
flag2 <- rownames(flag)
a_list <- c("23","34","36","38","48","52","56","60","64","70","72","76","80","84","88")
m_list <- c("40","42","44","46","50","54","58","62","66","68","74","78","82","86","90")
# Identify target columns
target_cols <- grep(
paste(c(a_list, m_list), collapse = "|"),
names(df),
value = TRUE
)
# Recode only for Prolific participants
df[df$samp == "Prolific", target_cols] <- lapply(
df[df$samp == "Prolific", target_cols],
function(x) {
x <- as.numeric(x)
x[x == 4] <- 3
x[x == 5] <- 4
x
}
)
Missing Data
d <- subset(df, select=c(15:79,200:248))
# total percentage of missing data
mean(is.na(d))
## [1] 0.009459132
# total number of participants (rows) with any missing data
(sum(rowSums(is.na(d)) > 0))/nrow(d)
## [1] 0.03225806
d <- na.omit(subset(df, select=c(id,15:79,200:248)))
backup <- df
df <- subset(df, df$id %in% d$id)
Attention Checks
# attention check
attn <- subset(labels1, grepl("attention", X1))
attn_chk <- rownames(attn)
# Q18_12 == 4
df$Q18_12 <- as.numeric(df$Q18_12)
table(df$Q18_12)
##
## 1 2 3 4
## 5 7 4 194
# Q28_4 > 9
df$Q28_4 <- as.numeric(df$Q28_4)
table(df$Q28_4)
##
## 1 2 3 4 5 6 7 8 9 10 11
## 1 1 3 3 4 3 2 4 1 63 125
table(df$Q28_4 <= 9, useNA = "ifany")
##
## FALSE TRUE
## 188 22
backup <- df
df <- subset(df, df$Q28_4 > 9 & Q18_12 == 4)
Misinformation
Acceptance
df_temp_subset <- select(df, all_of(flag2))
df_temp_subset[] <- lapply(df_temp_subset, function(x) {
x[x == ""] <- NA
as.numeric(x)
})
df_temp_subset_a <- df_temp_subset[ , grepl(paste(a_list, collapse="|"), names(df_temp_subset))]
df_temp_subset_m <- df_temp_subset[ , grepl(paste(m_list, collapse="|"), names(df_temp_subset))]
a_list_cred <- c("23","34","36","38","48","70","84")
m_list_cred <- c("40","44","46","50","54","68","90")
a_list_de <- c("38","48","52","56","76","88")
m_list_de <- c("42","46","50","54","58","62","78","86")
df_temp_subset_a_cred <- df_temp_subset[ , grepl(paste(a_list_cred, collapse="|"), names(df_temp_subset))]
df_temp_subset_m_cred <- df_temp_subset[ , grepl(paste(m_list_cred, collapse="|"), names(df_temp_subset))]
df$acc_cred <- rowMeans(df_temp_subset_a_cred, na.rm = TRUE)
df$mis_cred <- rowMeans(df_temp_subset_m_cred, na.rm = T)
df_temp_subset_m_de <- df_temp_subset[ , grepl(paste(m_list_de, collapse="|"), names(df_temp_subset))]
df_temp_subset_a_de <- df_temp_subset[ , grepl(paste(a_list_de, collapse="|"), names(df_temp_subset))]
df$mis_rating_de <- rowMeans(df_temp_subset_m_de, na.rm = T)
df$acc_rating_de <- rowMeans(df_temp_subset_a_de, na.rm = T)
df <- df %>%
mutate(
across(
c(acc_cred, acc_rating_de, mis_cred, mis_rating_de),
~ ifelse(is.nan(.), NA, .)
)
)
# build combined item sets (unique), then subset once
a_list_all <- unique(c(a_list_cred, a_list_de))
m_list_all <- unique(c(m_list_cred, m_list_de))
df_temp_subset_a_all <- df_temp_subset[ , grepl(paste(a_list_all, collapse="|"), names(df_temp_subset))]
df_temp_subset_m_all <- df_temp_subset[ , grepl(paste(m_list_all, collapse="|"), names(df_temp_subset))]
df$acc_rating <- rowMeans(df_temp_subset_a_all, na.rm = TRUE)
df$mis_rating <- rowMeans(df_temp_subset_m_all, na.rm = TRUE)
df <- df %>%
mutate(
across(
c(acc_rating, mis_rating),
~ ifelse(is.nan(.), NA, .)
)
)
Inequality-Driven
Mistrust
df$Q18_1 <- as.numeric(df$Q18_1)
df$Q18_2 <- as.numeric(df$Q18_2)
df$Q18_3 <- as.numeric(df$Q18_3)
df$Q18_4 <- as.numeric(df$Q18_4)
df$Q18_5 <- as.numeric(df$Q18_5)
df$Q18_6 <- as.numeric(df$Q18_6)
df$Q18_7 <- as.numeric(df$Q18_7)
df$Q18_8 <- as.numeric(df$Q18_8)
df$Q18_9 <- as.numeric(df$Q18_9)
df$Q18_10 <- as.numeric(df$Q18_10)
df$Q18_11 <- as.numeric(df$Q18_11)
df$Q18_12 <- as.numeric(df$Q18_12)
df$Q18_13 <- as.numeric(df$Q18_13)
df$Q18_14 <- as.numeric(df$Q18_14)
df$Q18_15 <- as.numeric(df$Q18_15)
df$Q18_16 <- as.numeric(df$Q18_16)
df$idm_dp <- (df$Q18_13 + df$Q18_14 + df$Q18_15 + df$Q18_16) / 4
df$idm_da <- (df$Q18_2 + df$Q18_8 + df$Q18_9 + df$Q18_10 + df$Q18_11) / 5
df$idm_ib <- (df$Q18_3 + df$Q18_4 + df$Q18_5 + df$Q18_6) / 4
describe(subset(df, select=c(idm_dp, idm_da, idm_ib)))
## vars n mean sd median trimmed mad min max range skew kurtosis se
## idm_dp 1 184 2.36 0.69 2.50 2.37 0.74 1 4 3 -0.12 -0.56 0.05
## idm_da 2 184 1.88 0.74 1.80 1.80 0.89 1 4 3 0.67 -0.19 0.05
## idm_ib 3 184 2.33 0.89 2.25 2.31 1.11 1 4 3 0.05 -1.12 0.07
psych::alpha(subset(df, select=c(Q18_13, Q18_14, Q18_15, Q18_16)))
##
## Reliability analysis
## Call: psych::alpha(x = subset(df, select = c(Q18_13, Q18_14, Q18_15,
## Q18_16)))
##
## raw_alpha std.alpha G6(smc) average_r S/N ase mean sd median_r
## 0.74 0.74 0.7 0.42 2.9 0.031 2.4 0.69 0.45
##
## 95% confidence boundaries
## lower alpha upper
## Feldt 0.67 0.74 0.8
## Duhachek 0.68 0.74 0.8
##
## Reliability if an item is dropped:
## raw_alpha std.alpha G6(smc) average_r S/N alpha se var.r med.r
## Q18_13 0.75 0.75 0.67 0.50 3.0 0.032 0.0012 0.50
## Q18_14 0.64 0.64 0.57 0.37 1.8 0.047 0.0211 0.33
## Q18_15 0.69 0.69 0.60 0.42 2.2 0.040 0.0072 0.43
## Q18_16 0.65 0.65 0.57 0.38 1.9 0.044 0.0129 0.43
##
## Item statistics
## n raw.r std.r r.cor r.drop mean sd
## Q18_13 184 0.68 0.67 0.49 0.42 2.8 0.94
## Q18_14 184 0.81 0.80 0.70 0.61 2.6 0.97
## Q18_15 184 0.74 0.75 0.63 0.53 2.1 0.89
## Q18_16 184 0.78 0.79 0.69 0.59 2.0 0.88
##
## Non missing response frequency for each item
## 1 2 3 4 miss
## Q18_13 0.10 0.27 0.38 0.24 0
## Q18_14 0.18 0.23 0.43 0.16 0
## Q18_15 0.30 0.39 0.25 0.06 0
## Q18_16 0.31 0.42 0.20 0.07 0
Item Stacked Bar
resp_labs <- c(
"1" = "Strongly disagree",
"2" = "Disagree",
"3" = "Agree",
"4" = "Strongly agree"
)
long <- df %>%
select(Q18_13:Q18_16) %>%
pivot_longer(everything(), names_to = "item", values_to = "resp") %>%
filter(!is.na(resp)) %>%
mutate(
resp = factor(resp, levels = 1:4, labels = resp_labs),
dir = ifelse(resp %in% resp_labs[1:2], -1, 1)
)
plot_df <- long %>%
count(item, resp, dir) %>%
mutate(n = n * dir)
plot_df <- plot_df %>%
mutate(resp = factor(resp,
levels = c("Strongly disagree","Disagree","Agree","Strongly agree")))
item_labs <- c(
Q18_13 = "I’d prefer to find things out for myself on the internet rather than asking others.",
Q18_14 = "If you put too much faith in what people tell you, you are likely to get hurt.",
Q18_15 = "When someone tells me something, my immediate reaction is to wonder why they are telling me this.",
Q18_16 = "I don’t usually act on advice that I get from others even when I think it’s probably sound."
)
ggplot(plot_df, aes(x = item, y = n, fill = resp)) +
geom_bar(stat = "identity", position = position_stack(reverse = TRUE), width = 0.7) +
coord_flip(clip = "off") +
scale_x_discrete(
labels = function(x) str_wrap(item_labs[x], width = 45)
) +
geom_hline(yintercept = 0) +
scale_y_continuous(labels = abs, expand = expansion(mult = c(0.15, 0.15))) +
labs(x = NULL, y = NULL, fill = NULL) +
theme_bw() +
theme(
axis.text.x = element_blank(),
axis.ticks.x = element_blank(),
panel.grid.major.x = element_blank(),
panel.grid.minor.x = element_blank(),
panel.grid.minor.y = element_blank()
) + theme(
legend.position = c(0.98, 0.98),
legend.justification = c(1, 1),
legend.background = element_rect(fill = "white", colour = NA),
legend.key = element_blank()
) + scale_fill_manual(
breaks = c("Strongly disagree","Disagree","Agree","Strongly agree"),
values = c(
"Strongly disagree" = "grey25",
"Disagree" = "grey45",
"Agree" = "grey65",
"Strongly agree" = "grey85"
)
)

# p <- ggplot(plot_df, aes(x = item, y = n, fill = resp)) +
# geom_bar(stat = "identity", position = position_stack(reverse = TRUE), width = 0.7) +
# coord_flip(clip = "off") +
# scale_x_discrete(labels = function(x) stringr::str_wrap(item_labs[x], width = 35)) +
# geom_hline(yintercept = 0) +
# scale_y_continuous(labels = abs, expand = expansion(mult = c(0.15, 0.15))) +
# labs(x = NULL, y = NULL, fill = NULL) +
# theme_bw() +
# theme(
# axis.text.y = element_text(size = 28), # item labels (y-axis visually, because coord_flip)
# legend.text = element_text(size = 20),
# legend.title = element_blank(),
# axis.text.x = element_blank(),
# axis.ticks.x = element_blank(),
# panel.grid.major.x = element_blank(),
# panel.grid.minor.x = element_blank(),
# panel.grid.minor.y = element_blank(),
# legend.position = c(0.98, 0.98),
# legend.justification = c(1, 1),
# legend.background = element_rect(fill = "white", colour = NA),
# legend.key = element_blank()
# ) +
# scale_fill_manual(
# breaks = c("Strongly disagree","Disagree","Agree","Strongly agree"),
# values = c(
# "Strongly disagree" = "grey25",
# "Disagree" = "grey45",
# "Agree" = "grey65",
# "Strongly agree" = "grey85"
# )
# ) + guides(
# fill = guide_legend(
# keyheight = unit(32, "pt"), # taller rows (main “line height” control)
# label.position = "right",
# byrow = TRUE
# )
# )
#
# p
#
# ggsave(
# filename = "Q18_stacked.svg",
# plot = p,
# device = svglite::svglite,
# width = 18.88,
# height = 8,
# units = "in"
# )
Regressions
Overall
# create z-scored versions without overwriting originals
vars <- c(
"mis_rating",
"acc_rating",
"mis_rating_de",
"acc_rating_de",
"acc_cred",
"mis_cred",
"idm_dp"
)
df[paste0(vars, "_z")] <- scale(df[vars])
df$condition <- as.factor(df$condition)
# reg_out1 <- lm(mis_rating_de ~ acc_rating_de, data = df)
reg_out1 <- lm(mis_rating_z ~ acc_rating_z, data = df)
summary(reg_out1)
##
## Call:
## lm(formula = mis_rating_z ~ acc_rating_z, data = df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.04222 -0.55996 -0.01573 0.56740 1.62311
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 5.650e-17 5.804e-02 0.00 1
## acc_rating_z 6.193e-01 5.820e-02 10.64 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.7873 on 182 degrees of freedom
## Multiple R-squared: 0.3836, Adjusted R-squared: 0.3802
## F-statistic: 113.2 on 1 and 182 DF, p-value: < 2.2e-16
# reg_out2 <- lm(mis_rating_de ~ idm_dp*condition + acc_rating_de, data = df)
reg_out2 <- lm(mis_rating_z ~ idm_dp_z*condition + acc_rating_z, data = df)
summary(reg_out2)
##
## Call:
## lm(formula = mis_rating_z ~ idm_dp_z * condition + acc_rating_z,
## data = df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.97219 -0.56942 -0.02887 0.55443 1.59197
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.003740 0.083354 -0.045 0.9643
## idm_dp_z 0.202464 0.086620 2.337 0.0205 *
## conditionm 0.008011 0.116667 0.069 0.9453
## acc_rating_z 0.611219 0.058999 10.360 <2e-16 ***
## idm_dp_z:conditionm -0.165975 0.116441 -1.425 0.1558
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.7816 on 179 degrees of freedom
## Multiple R-squared: 0.4025, Adjusted R-squared: 0.3892
## F-statistic: 30.15 on 4 and 179 DF, p-value: < 2.2e-16
# reg_out3 <- lm(acc_rating_de ~ idm_dp*condition + mis_rating_de, data = df)
# summary(reg_out3)
Danger
Everywhere
# reg_out1 <- lm(mis_rating_de ~ acc_rating_de, data = df)
reg_out1 <- lm(mis_rating_de_z ~ acc_rating_de_z, data = df)
summary(reg_out1)
##
## Call:
## lm(formula = mis_rating_de_z ~ acc_rating_de_z, data = df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.37696 -0.63856 0.09766 0.69106 1.61904
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.04513 0.07056 0.640 0.523
## acc_rating_de_z 0.51135 0.07100 7.202 2.47e-11 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.8811 on 154 degrees of freedom
## (28 observations deleted due to missingness)
## Multiple R-squared: 0.2519, Adjusted R-squared: 0.2471
## F-statistic: 51.87 on 1 and 154 DF, p-value: 2.466e-11
# reg_out2 <- lm(mis_rating_de ~ idm_dp*condition + acc_rating_de, data = df)
reg_out2 <- lm(mis_rating_de_z ~ idm_dp_z*condition + acc_rating_de_z, data = df)
summary(reg_out2)
##
## Call:
## lm(formula = mis_rating_de_z ~ idm_dp_z * condition + acc_rating_de_z,
## data = df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.61723 -0.63786 0.09097 0.64020 1.59728
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.05871 0.09587 0.612 0.5412
## idm_dp_z 0.24720 0.10247 2.412 0.0171 *
## conditionm -0.02089 0.14061 -0.149 0.8821
## acc_rating_de_z 0.50354 0.07064 7.128 3.91e-11 ***
## idm_dp_z:conditionm -0.16798 0.14086 -1.193 0.2349
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.8713 on 151 degrees of freedom
## (28 observations deleted due to missingness)
## Multiple R-squared: 0.2827, Adjusted R-squared: 0.2637
## F-statistic: 14.88 on 4 and 151 DF, p-value: 2.837e-10
# reg_out3 <- lm(acc_rating_de ~ idm_dp*condition + mis_rating_de, data = df)
# summary(reg_out3)
DE Plot
# # residualized DV: mis | acc
# mis_resid <- resid(
# lm(mis_rating_de_z ~ acc_rating_de_z, data = model.frame(reg_out2))
# )
#
# # residualized predictor: idm | acc
# idm_resid <- resid(
# lm(idm_dp_z ~ acc_rating_de_z, data = model.frame(reg_out2))
# )
#
# plot_df <- data.frame(
# idm_resid = idm_resid,
# mis_resid = mis_resid,
# condition = model.frame(reg_out2)$condition
# )
#
# p <- ggplot(plot_df, aes(x = idm_resid, y = mis_resid, color = condition)) +
# geom_point(alpha = .6) +
# geom_smooth(method = "lm", se = TRUE, color = "black") +
# scale_color_manual(
# name = "Condition",
# values = c("black", "#E6B10E"),
# labels = c("Majority Accurate", "Majority Misinformation")
# ) +
# labs(
# x = "Defensive Processing",
# y = "Misinformation Acceptance (Danger Everywhere Theme)"
# ) +
# theme_bw() +
# theme(
# text = element_text(size = 20),
# legend.position = c(0.95, 0.95),
# legend.justification = c(1, 1)
# )
#
# p
#
# ggsave(
# filename = "dereg.svg",
# plot = p,
# device = svglite::svglite,
# width = 7,
# height = 8.46,
# units = "in"
# )
Credibility
Claims
# reg_out1 <- lm(mis_cred ~ acc_cred, data = df)
reg_out1 <- lm(mis_cred_z ~ acc_cred_z, data = df)
summary(reg_out1)
##
## Call:
## lm(formula = mis_cred_z ~ acc_cred_z, data = df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.64949 -0.46702 -0.04269 0.52877 2.12770
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.003379 0.065315 -0.052 0.959
## acc_cred_z 0.506194 0.064773 7.815 5.23e-13 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.8615 on 172 degrees of freedom
## (10 observations deleted due to missingness)
## Multiple R-squared: 0.262, Adjusted R-squared: 0.2577
## F-statistic: 61.07 on 1 and 172 DF, p-value: 5.233e-13
# reg_out2 <- lm(mis_cred ~ idm_dp*condition + acc_cred, data = df)
reg_out2 <- lm(mis_cred_z ~ idm_dp_z*condition + acc_cred_z, data = df)
summary(reg_out2)
##
## Call:
## lm(formula = mis_cred_z ~ idm_dp_z * condition + acc_cred_z,
## data = df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.75061 -0.49977 0.00809 0.54241 2.33011
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.06194 0.09637 -0.643 0.52130
## idm_dp_z 0.27583 0.09744 2.831 0.00521 **
## conditionm 0.11122 0.13145 0.846 0.39870
## acc_cred_z 0.50802 0.06574 7.728 9.26e-13 ***
## idm_dp_z:conditionm -0.24634 0.12910 -1.908 0.05807 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.847 on 169 degrees of freedom
## (10 observations deleted due to missingness)
## Multiple R-squared: 0.2992, Adjusted R-squared: 0.2826
## F-statistic: 18.04 on 4 and 169 DF, p-value: 2.364e-12
plot_model(reg_out2, type="int") + ylim(-2,2)
## Warning: `aes_string()` was deprecated in ggplot2 3.0.0.
## i Please use tidy evaluation idioms with `aes()`.
## i See also `vignette("ggplot2-in-packages")` for more information.
## i The deprecated feature was likely used in the ggeffects package.
## Please report the issue at
## <https://github.com/strengejacke/ggeffects/issues/>.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## i Please use `linewidth` instead.
## i The deprecated feature was likely used in the ggeffects package.
## Please report the issue at
## <https://github.com/strengejacke/ggeffects/issues/>.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
## Scale for y is already present.
## Adding another scale for y, which will replace the existing scale.

# reg_out3 <- lm(acc_cred ~ idm_dp*condition + mis_cred, data = df)
# summary(reg_out3)
Cred Plot
# # residualized DV: mis | acc
# mis_resid <- resid(
# lm(mis_cred_z ~ acc_cred_z, data = model.frame(reg_out2))
# )
#
# # residualized predictor: idm | acc
# idm_resid <- resid(
# lm(idm_dp_z ~ acc_cred_z, data = model.frame(reg_out2))
# )
#
# plot_df <- data.frame(
# idm_resid = idm_resid,
# mis_resid = mis_resid,
# condition = model.frame(reg_out2)$condition
# )
#
# p <- ggplot(plot_df, aes(x = idm_resid, y = mis_resid, color = condition)) +
# geom_point(alpha = .6) +
# geom_smooth(method = "lm", se = TRUE, color = "black") +
# scale_color_manual(
# name = "Condition",
# values = c("black", "#E6B10E"),
# labels = c("Majority Accurate", "Majority Misinformation")
# ) +
# labs(
# x = "Defensive Processing",
# y = "Misinformation Acceptance (Credibility Claims)"
# ) +
# theme_bw() +
# theme(
# text = element_text(size = 20),
# legend.position = c(0.95, 0.95),
# legend.justification = c(1, 1)
# )
#
# p
#
# ggsave(
# filename = "ccreg.svg",
# plot = p,
# device = svglite::svglite,
# width = 7,
# height = 8.46,
# units = "in"
# )