knitr::opts_chunk$set(warning =FALSE, message =FALSE, fig.width=10, fig.height=8) Mypackages <-c("lme4","tidyverse","effects","ggplot2","psych","MASS","Rmisc","lmerTest","ggthemes", "knitr","lsmeans","pastecs","sjstats","car","ordinal","Rcpp","corrplot", "ggpubr", "EnvStats","easyStats", "cowplot","see","datawizard", "ggcorrplot","corrplot", "effects", "patchwork" )# install.packages(Mypackages) #you must remove the # in this comment if you need to install the packages! lapply(Mypackages, require,character.only =TRUE)options(knitr.kable.NA ='—')set.seed(1)
Load Data
Code
# read in data filesgjg <-read.csv("/Users/mtrenfield17/Desktop/Research/Boston College Research/Joint Research/Institutional Signaling/IS Study 2/Institutional Virtue Signaling Pilot 2.csv")
Functions
Code
plot_cooker <-function(data, iv, dv, title) { part1 <-ggplot(data, aes(x = {{iv}}, y = {{dv}}, fill = {{iv}})) +geom_violin(alpha =0.3, scale ="count") +stat_summary(fun ="mean", geom ="point", size =3, color ="black") +stat_summary(fun.data = mean_cl_normal, geom ="errorbar", width =0.2,#change to make a data set from allEffects with mean, low CI, high CIsize =1.5, color ="black") +theme_classic() +xlab("") +ylab("") +ggtitle(title)ggpar(part1, legend ="none")}wrapped_plot_cooker <-function(data, iv, dv, title, facet_var) { part1 <-ggplot(data, aes(x = {{iv}}, y = {{dv}}, fill = {{iv}})) +geom_violin(alpha =0.3, scale ="count") +stat_summary(fun ="mean", geom ="point", size =3, color ="black") +stat_summary(fun.data = mean_cl_normal, geom ="errorbar", width =0.2, size =1.5, color ="black") +theme_classic() +xlab("") +ylab("") +ggtitle(title) +facet_wrap(vars({{facet_var}}))ggpar(part1, legend ="none")}by_line <-function(data, iv, dv, x_label, y_label, color_label, plot_title) {ggplot(data, aes(x = {{iv}}, y = {{dv}}, color = condition)) +stat_summary(fun.data ="mean_cl_normal", geom ="line") +geom_point(position =position_jitter(width =0.1, height =0.1), alpha =0.2) +labs(x = x_label, y = y_label, color = color_label, title = plot_title)}
Reshaping data
Code
# making conservative, liberal, and moderate group gjg <- gjg %>%mutate(political_group =ifelse(pol <4, "Conservative",ifelse(pol >4, "Liberal", "Moderate")))#### filtering people who failed the attn check ####filtered_gjg <- gjg %>%filter(attentionCheck_text =="Companies' Social Media")#### make dataset long ####gjg_long<-filtered_gjg %>%gather(stim, resp, "B_S_Chic_staticNorm":"C_N_Tar_Prior") gjg_long<-gjg_long %>%separate(stim, into=c("social_issue", "signal", "company", "DV"), sep="_")## shift dataset back to wide format ##gjg_long <-spread(gjg_long, DV, resp)names(gjg_long)
gjg_long <- gjg_long %>%mutate_at(c("dyNorm", "noisyMin", "OComp", "OLike", "OMotivate", "OTrust", "peerPress", "Prior", "Profit", "pubPress", "Rep", "riskInact", "SComp", "SGen", "SImport", "SLike", "SRelImport", "staticNorm", "STrust", "surprise","post_Real_Check", "age", "pid", "area", "pol", "edu", "gen", "inc"), as.numeric)## Rename Vignettesgjg_long <- gjg_long %>%mutate(companyLeaning =case_when( company =="Bud"~"R", company =="CAR"~"R", company =="Chic"~"R", company =="Dis"~"L", company =="Pop"~"L", company =="Star"~"L", company =="Tar"~"L", company =="Wal"~"R", company =="WNBA"~"L", company =="Fox"~"R", company =="NBC"~"L", company =="NBA"~"L", company =="NFL"~"R",TRUE~ company # if none of the above conditions are met, keep the original value ))gjg_long$condition <-paste0(gjg_long$companyLeaning, gjg_long$signal)gjg_long <-subset(gjg_long, !(condition =="CS"& company =="Chic"&!is.na(Rep)))gjg_long <- gjg_long %>%mutate(condition =case_when( condition =="LS"~"Liberal \n\ Progressive Mess.", condition =="LN"~"Liberal \n\ Control", condition =="RS"~"Conservative \n\ Progressive Mess.", condition =="RN"~"Conservative \n\ Control",TRUE~ condition # if none of the above conditions are met, keep the original value ))gjg_long <- gjg_long %>%mutate(companyLeaning =case_when( companyLeaning =="R"~"Right", companyLeaning =="L"~"Left",TRUE~ companyLeaning # if none of the above conditions are met, keep the original value ))gjg_long <- gjg_long %>%mutate(company =case_when( company =="Bud"~"Budweiser", company =="CAR"~"NASCAR", company =="Chic"~"Chick-fil-A", company =="Dis"~"Disney", company =="Pop"~"Popeyes", company =="Star"~"Starbucks", company =="Tar"~"Target", company =="Wal"~"Walmart",TRUE~ company # if none of the above conditions are met, keep the original value ))# ## Rename Conditions# gjg_long$signal <- as.factor(gjg_long$signal)# gjg_long <- gjg_long %>%# mutate(signal = case_when(# signal == "S" ~ "Signal",# signal == "N" ~ "No Signal",# TRUE ~ signal # if none of the above conditions are met, keep the original value# ))gjg_long$social_issue <-as.factor(gjg_long$social_issue)gjg_long <- gjg_long %>%mutate(social_issue =case_when( social_issue =="T"~"Transgendered Representation", social_issue =="C"~"Climate Change", social_issue =="L"~"LGBTQ Representation", social_issue =="B"~"BLM",TRUE~ social_issue # if none of the above conditions are met, keep the original value ))## data frame just with signaling messagessignal_gjg_long <- gjg_long %>%filter(signal =="Signal")## filter out rows for condition-vignette pairs people DON'T seegjg_long <- gjg_long %>%filter(is.na(dyNorm) ==FALSE)
Attention Check
Code
gjg %>%group_by(attentionCheck) %>% dplyr::summarise(n =n()) %>%mutate(freq = n /sum(n))
59/801 people were excluded: 29 failed the attention check. 30 did not consent.
Demographics
Code
# Subset your data frame to include only the demographic columnsdemo_gjg <- gjg[, c("gen_text", "race_text", "inc_text", "edu_text", "pol_text", "pid_text", "area_text")]# Agemean(gjg$age, na.rm=TRUE)
[1] 42.75062
Code
sd(gjg$age, na.rm=TRUE)
[1] 14.02753
Code
# Loop through each demographic column and calculate frequency countsfreq_tables <-list()for (col innames(demo_gjg)) { { freq_table <-as.data.frame(table(demo_gjg[[col]])) freq_table$Percent <-round(freq_table$Freq /sum(freq_table$Freq) *100, 2) freq_tables[[col]] <- freq_table }}# Print the frequency tablesfor (i inseq_along(freq_tables)) {if (!is.null(freq_tables[[i]])) {cat("\nTable of frequencies for", names(freq_tables)[i], ":\n")print(freq_tables[[i]]) }}
Table of frequencies for gen_text :
Var1 Freq Percent
1 30 3.6
2 I identify as: 10 1.2
3 Man 399 47.9
4 Woman 394 47.3
Table of frequencies for race_text :
Var1
1
2 American Indian and Native Alaskan
3 American Indian and Native Alaskan,Black
4 American Indian and Native Alaskan,Black,East Asian,South Asian,Southeast Asian,Pacific Islander or Native Hawaiian,Hispanic or Latino/a/x,Middle Eastern and North African,White
5 American Indian and Native Alaskan,Black,Hispanic or Latino/a/x,Middle Eastern and North African,White
6 American Indian and Native Alaskan,Black,Hispanic or Latino/a/x,White
7 American Indian and Native Alaskan,Hispanic or Latino/a/x,White
8 American Indian and Native Alaskan,White
9 Black
10 Black,East Asian,Hispanic or Latino/a/x,White
11 Black,Hispanic or Latino/a/x
12 Black,White
13 East Asian
14 East Asian,Hispanic or Latino/a/x,White
15 East Asian,Middle Eastern and North African
16 East Asian,White
17 Hispanic or Latino/a/x
18 Hispanic or Latino/a/x,White
19 Middle Eastern and North African
20 Middle Eastern and North African,White
21 South Asian
22 South Asian,Hispanic or Latino/a/x,Middle Eastern and North African,White
23 Southeast Asian
24 Southeast Asian,White
25 White
Freq Percent
1 31 3.72
2 4 0.48
3 1 0.12
4 1 0.12
5 1 0.12
6 1 0.12
7 2 0.24
8 3 0.36
9 61 7.32
10 1 0.12
11 1 0.12
12 11 1.32
13 28 3.36
14 2 0.24
15 1 0.12
16 9 1.08
17 42 5.04
18 21 2.52
19 3 0.36
20 3 0.36
21 8 0.96
22 1 0.12
23 17 2.04
24 2 0.24
25 578 69.39
Table of frequencies for inc_text :
Var1 Freq Percent
1 31 3.72
2 $100,000 - $149,999 94 11.28
3 $150,000 - $199,999 44 5.28
4 $25,000 - $49,999 205 24.61
5 $50,000 - $74,999 166 19.93
6 $75,000 - $99,999 118 14.17
7 less than $25,000 143 17.17
8 more than $200,000 32 3.84
Table of frequencies for edu_text :
Var1 Freq Percent
1 31 3.72
2 Bachelor's degree 289 34.69
3 Graduate degree (Masters, PhD, etc) 117 14.05
4 High school diploma or GED 137 16.45
5 Some college, Technical degree, or Associates degree 250 30.01
6 Some schooling, but no high school diploma or degree 9 1.08
Table of frequencies for pol_text :
Var1 Freq Percent
1 30 3.60
2 Conservative 132 15.85
3 Liberal 138 16.57
4 Moderate 185 22.21
5 Somewhat Conservative 107 12.85
6 Somewhat Liberal 98 11.76
7 Very Conservative 59 7.08
8 Very Liberal 84 10.08
Table of frequencies for pid_text :
Var1 Freq Percent
1 30 3.60
2 Democrat 292 35.05
3 Independent / Other 263 31.57
4 Republican 248 29.77
Table of frequencies for area_text :
Var1 Freq Percent
1 30 3.60
2 Rural 184 22.09
3 Suburban 438 52.58
4 Urban 181 21.73
selfCompanyP <-ggplot(gjg_long, aes(x = companyLeaning, y = selfCompany, color = signal)) +geom_point(stat ="summary", fun ="mean", size =2, position =position_dodge(width =0.25)) +geom_hline(yintercept =4, linetype ="dashed", color ="black", size = .7, alpha =0.4) +stat_summary(fun.data ="mean_cl_normal", geom ="errorbar", position =position_dodge(width =0.25), width =0.2, size =0.5) +scale_x_discrete(labels =c("Liberal", "Conservative")) +scale_y_continuous(breaks =1:7, limits =c(1, 7)) +# Set y-axis to be from 1 to 7scale_color_manual(values =c("N"="#B550B5", "S"="#00C957"),labels =c("Consistent", "Inconsistent"),name ="Consistency of \n\ Message and signal") +labs(x ="Company's Political Leaning", y ="Perception of the Company", title ="Participants' Afinity for the Company (N = 769)") +theme(plot.title =element_text(hjust =0.5, size =18),axis.text.x =element_text(face ="plain", size =17, color ="black"),axis.text.y =element_text(face ="plain", size =15, color ="black"),axis.title.y =element_text(face ="plain", size =17, color ="black"), axis.title.x =element_text(face ="plain", size =15, color ="black"),legend.title =element_text(size =14), # Increase legend title sizelegend.text =element_text(size =12) )# Print the plotprint(selfCompanyP)
Plot by Pol Group
Code
gjg_long$political_group <-factor(gjg_long$political_group, levels =c("Liberal", "Moderate", "Conservative"))selfCompanyP_polGroup <-ggplot(gjg_long, aes(x = companyLeaning, y = selfCompany, color = signal)) +geom_point(stat ="summary", fun ="mean", size =2, position =position_dodge(width =0.25)) +geom_hline(yintercept =4, linetype ="dashed", color ="black", size = .7, alpha =0.4) +stat_summary(fun.data ="mean_cl_normal", geom ="errorbar", position =position_dodge(width =0.25), width =0.2, size =0.5) +scale_x_discrete(labels =c("Liberal", "Conservative")) +scale_y_continuous(breaks =1:7, limits =c(1, 7)) +# Set y-axis to be from 1 to 7scale_color_manual(values =c("N"="#B550B5", "S"="#00C957"),labels =c("Consistent", "Inconsistent"),name ="Consistency of \n\ Message and signal") +labs(x ="Company's Political Leaning", y ="Perception of the Company", title ="Participants' Afinity for the Company (N = 799)") +theme(plot.title =element_text(hjust =0.5, size =18),axis.text.x =element_text(face ="plain", size =17, color ="black"),axis.text.y =element_text(face ="plain", size =15, color ="black"),axis.title.y =element_text(face ="plain", size =17, color ="black"), axis.title.x =element_text(face ="plain", size =15, color ="black"),legend.title =element_text(size =14), # Increase legend title sizelegend.text =element_text(size =12) ) +facet_wrap("political_group")# Print the plotprint(selfCompanyP_polGroup)
Line by Pol
Code
ggplot(gjg_long, aes(x = pol, y = selfCompany, color = condition)) +stat_summary(fun.data ="mean_cl_normal", geom ="line") +geom_hline(yintercept =4, linetype ="dashed", color ="black", size = .7, alpha =0.4) +# geom_point(position = position_jitter(width = 0.1, height = 0.1), alpha = 0.2) +labs(x ="Participant Political Leaning \n\ (Conservative to Liberal)", y ="Perception of the Company", color ="Company Political Leaning \n\ & Signal", title ="Participants' Afinity for the Company") +coord_cartesian(ylim =c(1, 7)) +scale_y_continuous(breaks =c(1,2,3,4,5,6,7))
Stats
politics matters
company’s perceived political leaning matters to libs and mods
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: selfCompany ~ companyLeaning * signal * pol + (1 | prolificID) +
(1 | social_issue)
Data: gjg_long
REML criterion at convergence: 10418
Scaled residuals:
Min 1Q Median 3Q Max
-4.1914 -0.5423 0.0611 0.5672 3.5690
Random effects:
Groups Name Variance Std.Dev.
prolificID (Intercept) 0.89694 0.9471
social_issue (Intercept) 0.01469 0.1212
Residual 1.21252 1.1011
Number of obs: 3076, groups: prolificID, 769; social_issue, 4
Fixed effects:
Estimate Std. Error df t value
(Intercept) 3.721e+00 1.448e-01 7.749e+01 25.706
companyLeaningRight 5.908e-01 1.410e-01 2.299e+03 4.189
signalS -3.039e-01 1.410e-01 2.298e+03 -2.156
pol 1.616e-01 2.935e-02 1.990e+03 5.505
companyLeaningRight:signalS -2.359e-02 1.994e-01 2.299e+03 -0.118
companyLeaningRight:pol -2.724e-01 3.149e-02 2.299e+03 -8.650
signalS:pol 8.971e-02 3.148e-02 2.299e+03 2.850
companyLeaningRight:signalS:pol 5.975e-03 4.454e-02 2.299e+03 0.134
Pr(>|t|)
(Intercept) < 2e-16 ***
companyLeaningRight 2.91e-05 ***
signalS 0.03122 *
pol 4.18e-08 ***
companyLeaningRight:signalS 0.90585
companyLeaningRight:pol < 2e-16 ***
signalS:pol 0.00441 **
companyLeaningRight:signalS:pol 0.89329
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Correlation of Fixed Effects:
(Intr) cmpnLR signlS pol cmLR:S cmpLR: sgnlS:
cmpnyLnngRg -0.487
signalS -0.487 0.500
pol -0.833 0.492 0.492
cmpnyLnnR:S 0.344 -0.707 -0.707 -0.348
cmpnyLnngR: 0.447 -0.917 -0.459 -0.536 0.649
signalS:pol 0.447 -0.459 -0.917 -0.536 0.649 0.500
cmpnyLnR:S: -0.316 0.649 0.649 0.379 -0.917 -0.707 -0.707
Others’ Perception of Company
Plot
7 point agreement scale
Code
otherCompanyP <-ggplot(gjg_long, aes(x = companyLeaning, y = otherCompany, color = signal)) +geom_point(stat ="summary", fun ="mean", size =2, position =position_dodge(width =0.25)) +geom_hline(yintercept =4, linetype ="dashed", color ="black", size = .7, alpha =0.4) +stat_summary(fun.data ="mean_cl_normal", geom ="errorbar", position =position_dodge(width =0.25), width =0.2, size =0.5) +scale_x_discrete(labels =c("Liberal", "Conservative")) +scale_y_continuous(breaks =1:7, limits =c(1, 7)) +# Set y-axis to be from 1 to 7scale_color_manual(values =c("N"="#B550B5", "S"="#00C957"),labels =c("Consistent", "Inconsistent"),name ="Consistency of \n\ Message and signal") +labs(x ="Company's Political Leaning", y ="Perception of the Company", title ="Participants' Perception of Others' Afinity for the Company (N = 799)") +theme(plot.title =element_text(hjust =0.5, size =18),axis.text.x =element_text(face ="plain", size =17, color ="black"),axis.text.y =element_text(face ="plain", size =15, color ="black"),axis.title.y =element_text(face ="plain", size =17, color ="black"), axis.title.x =element_text(face ="plain", size =15, color ="black"),legend.title =element_text(size =14), # Increase legend title sizelegend.text =element_text(size =12) ) print(otherCompanyP)
Plot by Pol Group
Pluralistic ignorance – people think others like companies more than they do
Code
otherCompanyP_polGroup <-ggplot(gjg_long, aes(x = companyLeaning, y = otherCompany, color = signal)) +geom_point(stat ="summary", fun ="mean", size =2, position =position_dodge(width =0.25)) +geom_hline(yintercept =4, linetype ="dashed", color ="black", size = .7, alpha =0.4) +stat_summary(fun.data ="mean_cl_normal", geom ="errorbar", position =position_dodge(width =0.25), width =0.2, size =0.5) +scale_x_discrete(labels =c("Liberal", "Conservative")) +scale_color_manual(values =c("N"="#B550B5", "S"="#00C957"),labels =c("Consistent", "Inconsistent"),name ="Consistency of \n\ Message and signal") +labs(x ="Participant's Political Leaning", y ="Perception of the Company", title ="Participants' Perception of Others' Affinity for the Company (N = 799)") +theme(plot.title =element_text(hjust =0.5, size =18),axis.text.x =element_text(face ="plain", size =17, color ="black"),axis.text.y =element_text(face ="plain", size =15, color ="black"),axis.title.y =element_text(face ="plain", size =17, color ="black"), axis.title.x =element_text(face ="plain", size =15, color ="black"),legend.title =element_text(size =14), # Increase legend title sizelegend.text =element_text(size =12) ) +facet_wrap("political_group") +coord_cartesian(ylim =c(1, 7)) +scale_y_continuous(breaks =c(1,2,3,4,5,6,7)) # Print the plotprint(otherCompanyP_polGroup)
Code
# Code to combine self + other perception plot## library(patchwork)## selfCompanyP + otherCompanyP + plot_layout(guides = 'collect')
Line by Pol
Code
ggplot(gjg_long, aes(x = pol, y = otherCompany, color = condition)) +stat_summary(fun.data ="mean_cl_normal", geom ="line") +geom_hline(yintercept =4, linetype ="dashed", color ="black", size = .7, alpha =0.4) +# geom_point(position = position_jitter(width = 0.1, height = 0.1), alpha = 0.2) +labs(x ="Participant Political Leaning \n\ (Conservative to Liberal)", y ="Perception of the Company", color ="Company Political Leaning \n\ & Signal", title ="Participants' Perception of Others' Afinity for the Company") +coord_cartesian(ylim =c(1, 7)) +scale_y_continuous(breaks =c(1,2,3,4,5,6,7))
Stats
main effect of company leaning and participant political leaning
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: otherCompany ~ companyLeaning * signal * pol + (1 | prolificID) +
(1 | social_issue)
Data: gjg_long
REML criterion at convergence: 9136.1
Scaled residuals:
Min 1Q Median 3Q Max
-4.9351 -0.4119 0.0886 0.5460 3.0648
Random effects:
Groups Name Variance Std.Dev.
prolificID (Intercept) 0.51729 0.7192
social_issue (Intercept) 0.01024 0.1012
Residual 0.82244 0.9069
Number of obs: 3076, groups: prolificID, 769; social_issue, 4
Fixed effects:
Estimate Std. Error df t value
(Intercept) 4.87670 0.11634 67.32806 41.918
companyLeaningRight -0.13207 0.11615 2298.71992 -1.137
signalS -0.23353 0.11610 2298.38690 -2.011
pol 0.08668 0.02339 2121.04020 3.706
companyLeaningRight:signalS 0.18979 0.16426 2298.71992 1.155
companyLeaningRight:pol -0.03194 0.02594 2298.92501 -1.231
signalS:pol 0.06603 0.02592 2298.48713 2.547
companyLeaningRight:signalS:pol -0.05786 0.03668 2298.92501 -1.577
Pr(>|t|)
(Intercept) < 2e-16 ***
companyLeaningRight 0.255631
signalS 0.044400 *
pol 0.000216 ***
companyLeaningRight:signalS 0.248013
companyLeaningRight:pol 0.218339
signalS:pol 0.010926 *
companyLeaningRight:signalS:pol 0.114868
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Correlation of Fixed Effects:
(Intr) cmpnLR signlS pol cmLR:S cmpLR: sgnlS:
cmpnyLnngRg -0.499
signalS -0.499 0.500
pol -0.826 0.509 0.508
cmpnyLnnR:S 0.353 -0.707 -0.707 -0.360
cmpnyLnngR: 0.458 -0.917 -0.459 -0.554 0.649
signalS:pol 0.458 -0.459 -0.917 -0.554 0.649 0.500
cmpnyLnR:S: -0.324 0.649 0.649 0.392 -0.917 -0.707 -0.707
Combining self + other perception plot
Code
# # Code to combine self + other perception plot# library(patchwork)# selfCompanyP + otherCompanyP + plot_layout(guides = 'collect')# # # Adjust the titles to make sure they fit# selfCompanyP_patch <- selfCompanyP + # labs(title = "My Perception of the Company is Positive") + # theme(plot.margin = margin(1, 1, 1, 1, "lines")) # Increase the top margin# # otherCompanyP_patch <- otherCompanyP + # labs(title = "Others' Perception of the Company is Positive") +# theme(plot.margin = margin(1, 1, 1, 1, "lines"),# axis.title.y = element_blank(), # Remove y-axis title# axis.ticks.y = element_blank(), # Remove y-axis ticks# axis.text.y = element_blank()) # Remove y-axis text# # # Combine the plots with patchwork, adjusting the layout# combinedPlot <- selfCompanyP_patch + otherCompanyP_patch + plot_layout(guides = 'collect')# # # Print the combined plot# print(combinedPlot)
Genuine
Main Plot
Composite
7 point agreement scale
Code
genP <-ggplot(gjg_long, aes(x = companyLeaning, y = SGen, color = signal)) +geom_point(stat ="summary", fun ="mean", size =4, position =position_dodge(width =0.25)) +# Increased point sizestat_summary(fun.data ="mean_cl_normal", geom ="errorbar", position =position_dodge(width =0.25), width =0.2, size =1.5) +# Increased error bar sizegeom_hline(yintercept =4, linetype ="dashed", color ="black", size = .7, alpha =0.4) +scale_x_discrete(labels =c("Liberal", "Conservative")) +scale_color_manual(values =c("N"="#B550B5", "S"="#00C957"),labels =c("Consistent", "Inconsistent"),name ="Company Political Leaning \n\ & Signal") +labs(x ="Company Political Leaning", y ="How much does the company genuinely care", title ="Perception of the Authenticity of the Company's Support" ) +theme_minimal(base_size =15) +theme(plot.title =element_text(hjust =0.5, size =25),axis.text.x =element_text(face ="plain", size =20, color ="black"),axis.text.y =element_text(face ="plain", size =20, color ="black"),axis.title.y =element_text(face ="plain", size =22, color ="black"), axis.title.x =element_text(face ="plain", size =22, color ="black"),legend.position ="bottom",legend.title =element_text(size =22), # Adjusted legend title sizelegend.text =element_text(size =20), # Adjusted legend text sizepanel.grid.major =element_line(color ="gray"),panel.grid.minor =element_blank(),panel.background =element_rect(fill ="white", color ="white"),panel.border =element_rect(color ="black", fill =NA, size =1) ) +coord_cartesian(ylim =c(1, 7)) +# Adjusted y limits to match scale_y_continuousscale_y_continuous(breaks =c(1, 2, 3, 4, 5, 6, 7), labels =c("-3","-2", "-1", "0", "1", "2", "3"))# Print the plotprint(genP)
Plot by Pol Group
Composite
7 point agreement scale
Code
genP_polGroup <-ggplot(gjg_long, aes(x = companyLeaning, y = SGen, color = signal)) +geom_point(stat ="summary", fun ="mean", size =4, position =position_dodge(width =0.25)) +# Increased point sizestat_summary(fun.data ="mean_cl_normal", geom ="errorbar", position =position_dodge(width =0.25), width =0.2, size =1.5) +# Increased error bar sizegeom_hline(yintercept =4, linetype ="dashed", color ="black", size = .7, alpha =0.4) +scale_x_discrete(labels =c("Liberal", "Conservative")) +scale_color_manual(values =c("N"="#B550B5", "S"="#00C957"),labels =c("Consistent", "Inconsistent"),name ="Company Political Leaning \n\ & Signal") +labs(x ="Company Political Leaning", y ="How much does the company genuinely care", title ="Perception of the Authenticity of the Company's Support" ) +theme_minimal(base_size =15) +theme(plot.title =element_text(hjust =0.5, size =25),axis.text.x =element_text(face ="plain", size =20, color ="black"),axis.text.y =element_text(face ="plain", size =20, color ="black"),axis.title.y =element_text(face ="plain", size =22, color ="black"), axis.title.x =element_text(face ="plain", size =22, color ="black"),legend.position ="bottom",legend.title =element_text(size =22), # Adjusted legend title sizelegend.text =element_text(size =20), # Adjusted legend text sizepanel.grid.major =element_line(color ="gray"),panel.grid.minor =element_blank(),panel.background =element_rect(fill ="white", color ="white"),panel.border =element_rect(color ="black", fill =NA, size =1) ) +facet_wrap("political_group") +coord_cartesian(ylim =c(1, 7)) +# Adjusted y limits to match scale_y_continuousscale_y_continuous(breaks =c(1, 2, 3, 4, 5, 6, 7), labels =c("-3","-2", "-1", "0", "1", "2", "3"))# Print the plotprint(genP_polGroup)
Line by Pol
Code
ggplot(gjg_long, aes(x = pol, y = SGen, color = condition)) +stat_summary(fun.data ="mean_cl_normal", geom ="line") +geom_hline(yintercept =4, linetype ="dashed", color ="black", size = .7, alpha =0.4) +# geom_point(position = position_jitter(width = 0.1, height = 0.1), alpha = 0.2) +labs(x ="Participant Political Leaning \n\ (Conservative to Liberal)", y ="How much does the company genuinely care", color ="Company Political Leaning \n\ & Signal", title ="Perception of the Authenticity of the Company's Support") +labs(x ="Company Political Leaning", y ="Motive Selflessness", title ="Motive Authenticity" ) +coord_cartesian(ylim =c(1, 7)) +scale_y_continuous(breaks =c(1,2,3,4,5,6,7))
Stats
main effect of company leaning, signal consistency, and participant political leaning
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: SGen ~ companyLeaning * signal * pol + (1 | prolificID) + (1 |
social_issue)
Data: gjg_long
REML criterion at convergence: 11145.4
Scaled residuals:
Min 1Q Median 3Q Max
-3.4674 -0.5940 0.0322 0.6101 3.3835
Random effects:
Groups Name Variance Std.Dev.
prolificID (Intercept) 1.14946 1.0721
social_issue (Intercept) 0.01881 0.1371
Residual 1.53306 1.2382
Number of obs: 3076, groups: prolificID, 769; social_issue, 4
Fixed effects:
Estimate Std. Error df t value
(Intercept) 3.61259 0.16333 76.85338 22.118
companyLeaningRight 0.16805 0.15857 2298.73167 1.060
signalS 0.09722 0.15851 2298.39476 0.613
pol 0.11097 0.03310 1979.47268 3.353
companyLeaningRight:signalS -0.13950 0.22426 2298.73167 -0.622
companyLeaningRight:pol -0.20247 0.03541 2298.93898 -5.717
signalS:pol 0.05333 0.03539 2298.49620 1.507
companyLeaningRight:signalS:pol 0.02502 0.05008 2298.93898 0.500
Pr(>|t|)
(Intercept) < 2e-16 ***
companyLeaningRight 0.289359
signalS 0.539717
pol 0.000816 ***
companyLeaningRight:signalS 0.533964
companyLeaningRight:pol 1.22e-08 ***
signalS:pol 0.132004
companyLeaningRight:signalS:pol 0.617420
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Correlation of Fixed Effects:
(Intr) cmpnLR signlS pol cmLR:S cmpLR: sgnlS:
cmpnyLnngRg -0.485
signalS -0.485 0.500
pol -0.832 0.491 0.490
cmpnyLnnR:S 0.343 -0.707 -0.707 -0.347
cmpnyLnngR: 0.445 -0.917 -0.459 -0.535 0.649
signalS:pol 0.445 -0.459 -0.917 -0.535 0.649 0.500
cmpnyLnR:S: -0.315 0.649 0.649 0.378 -0.917 -0.707 -0.707
Motive Authenticity
Main Plot
Composite
7 point agreement scale
Code
gjg_long <- gjg_long %>%mutate(reverseExternalMotive =7-externalMotive) # reversing external motive scale so selfish is negativeexternalP <-ggplot(gjg_long, aes(x = companyLeaning, y = reverseExternalMotive, color = signal)) +geom_point(stat ="summary", fun ="mean", size =4, position =position_dodge(width =0.25)) +# Increased point sizestat_summary(fun.data ="mean_cl_normal", geom ="errorbar", position =position_dodge(width =0.25), width =0.2, size =1.5) +# Increased error bar sizegeom_hline(yintercept =4, linetype ="dashed", color ="black", size = .7, alpha =0.4) +scale_x_discrete(labels =c("Liberal", "Conservative")) +scale_color_manual(values =c("N"="#B550B5", "S"="#00C957"),labels =c("Consistent", "Inconsistent"),name ="Company Political Leaning \n\ & Signal") +labs(x ="Company Political Leaning", y ="Motive Selflessness", title ="Motive Authenticity" ) +theme_minimal(base_size =15) +theme(plot.title =element_text(hjust =0.5, size =25),axis.text.x =element_text(face ="plain", size =20, color ="black"),axis.text.y =element_text(face ="plain", size =20, color ="black"),axis.title.y =element_text(face ="plain", size =22, color ="black"), axis.title.x =element_text(face ="plain", size =22, color ="black"),legend.position ="bottom",legend.title =element_text(size =22), # Adjusted legend title sizelegend.text =element_text(size =20), # Adjusted legend text sizepanel.grid.major =element_line(color ="gray"),panel.grid.minor =element_blank(),panel.background =element_rect(fill ="white", color ="white"),panel.border =element_rect(color ="black", fill =NA, size =1) ) +coord_cartesian(ylim =c(1, 7)) +# Adjusted y limits to match scale_y_continuousscale_y_continuous(breaks =c(1, 2, 3, 4, 5, 6, 7), labels =c("-3","-2", "-1", "0", "1", "2", "3"))# Print the plotprint(externalP)
Plot by Pol Group
Composite
7 point agreement scale
Code
externalP <-ggplot(gjg_long, aes(x = companyLeaning, y = reverseExternalMotive, color = signal)) +geom_point(stat ="summary", fun ="mean", size =4, position =position_dodge(width =0.25)) +# Increased point sizestat_summary(fun.data ="mean_cl_normal", geom ="errorbar", position =position_dodge(width =0.25), width =0.2, size =1.5) +# Increased error bar sizegeom_hline(yintercept =4, linetype ="dashed", color ="black", size = .7, alpha =0.4) +scale_x_discrete(labels =c("Liberal", "Conservative")) +scale_color_manual(values =c("N"="#B550B5", "S"="#00C957"),labels =c("Consistent", "Inconsistent"),name ="Company Political Leaning \n\ & Signal") +labs(x ="Company Political Leaning", y ="Motive Selflessness", title ="Motive Authenticity" ) +theme_minimal(base_size =15) +theme(plot.title =element_text(hjust =0.5, size =25),axis.text.x =element_text(face ="plain", size =20, color ="black"),axis.text.y =element_text(face ="plain", size =20, color ="black"),axis.title.y =element_text(face ="plain", size =22, color ="black"), axis.title.x =element_text(face ="plain", size =22, color ="black"),legend.position ="bottom",legend.title =element_text(size =22), # Adjusted legend title sizelegend.text =element_text(size =20), # Adjusted legend text sizepanel.grid.major =element_line(color ="gray"),panel.grid.minor =element_blank(),panel.background =element_rect(fill ="white", color ="white"),panel.border =element_rect(color ="black", fill =NA, size =1) ) +facet_wrap("political_group") +coord_cartesian(ylim =c(1, 7)) +# Adjusted y limits to match scale_y_continuousscale_y_continuous(breaks =c(1, 2, 3, 4, 5, 6, 7), labels =c("-3","-2", "-1", "0", "1", "2", "3"))# Print the plotprint(externalP)
Line by Pol
Code
ggplot(gjg_long, aes(x = pol, y = reverseExternalMotive, color = condition)) +stat_summary(fun.data ="mean_cl_normal", geom ="line") +geom_hline(yintercept =4, linetype ="dashed", color ="black", size = .7, alpha =0.4) +# geom_point(position = position_jitter(width = 0.1, height = 0.1), alpha = 0.2) +labs(x ="Participant Political Leaning \n\ (Conservative to Liberal)", y ="Perception of the Company", color ="Company Political Leaning \n\ & Signal", title ="Participants' Perception of Others' Afinity for the Company") +labs(x ="Company Political Leaning", y ="Motive Selflessness", title ="Motive Authenticity" ) +coord_cartesian(ylim =c(1, 7)) +scale_y_continuous(breaks =c(1,2,3,4,5,6,7))
Stats
main effect of company leaning, signal consistency, and participant political leaning
intersignal between ’s perceived political leaning matters to libs and mods
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: surprise ~ companyLeaning * signal * pol + (1 | prolificID) +
(1 | social_issue)
Data: gjg_long
REML criterion at convergence: 11803.2
Scaled residuals:
Min 1Q Median 3Q Max
-2.8608 -0.6912 -0.1495 0.6293 3.2010
Random effects:
Groups Name Variance Std.Dev.
prolificID (Intercept) 0.6803 0.8248
social_issue (Intercept) 0.1217 0.3488
Residual 2.1925 1.4807
Number of obs: 3076, groups: prolificID, 769; social_issue, 4
Fixed effects:
Estimate Std. Error df t value
(Intercept) 2.476e+00 2.323e-01 9.013e+00 10.662
companyLeaningRight 4.937e-01 1.896e-01 2.298e+03 2.603
signalS 4.081e-01 1.896e-01 2.298e+03 2.153
pol -1.620e-02 3.426e-02 2.627e+03 -0.473
companyLeaningRight:signalS 3.502e-01 2.682e-01 2.298e+03 1.306
companyLeaningRight:pol 1.482e-02 4.235e-02 2.298e+03 0.350
signalS:pol 5.419e-03 4.233e-02 2.298e+03 0.128
companyLeaningRight:signalS:pol 1.365e-01 5.990e-02 2.298e+03 2.279
Pr(>|t|)
(Intercept) 2.07e-06 ***
companyLeaningRight 0.0093 **
signalS 0.0314 *
pol 0.6364
companyLeaningRight:signalS 0.1918
companyLeaningRight:pol 0.7265
signalS:pol 0.8982
companyLeaningRight:signalS:pol 0.0228 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Correlation of Fixed Effects:
(Intr) cmpnLR signlS pol cmLR:S cmpLR: sgnlS:
cmpnyLnngRg -0.408
signalS -0.408 0.500
pol -0.606 0.567 0.567
cmpnyLnnR:S 0.289 -0.707 -0.707 -0.401
cmpnyLnngR: 0.374 -0.917 -0.459 -0.618 0.649
signalS:pol 0.374 -0.459 -0.917 -0.618 0.649 0.500
cmpnyLnR:S: -0.265 0.649 0.649 0.437 -0.917 -0.707 -0.708
Motivates Others to Act
Main Plot
Code
motivateP <-ggplot(gjg_long, aes(x = companyLeaning, y = OMotivate, color = signal)) +geom_point(stat ="summary", fun ="mean", size =4, position =position_dodge(width =0.25)) +# Increased point sizestat_summary(fun.data ="mean_cl_normal", geom ="errorbar", position =position_dodge(width =0.25), width =0.2, size =1.5) +# Increased error bar sizegeom_hline(yintercept =4, linetype ="dashed", color ="black", size = .7, alpha =0.4) +scale_x_discrete(labels =c("Liberal", "Conservative")) +scale_y_continuous(breaks =c(1, 2, 3, 4, 5, 6, 7), labels =c("-3","-2","-1", "0", "1", "2", "3"), ) +scale_color_manual(values =c("N"="#B550B5", "S"="#00C957"),labels =c("Consistent", "Inconsistent"),name ="signal") +labs(x ="Condition", y ="This post motivates support from others (Agreement)", title ="Surprise at Post" ) +theme_minimal(base_size =15) +theme(plot.title =element_text(hjust =0.5, size =25),axis.text.x =element_text(face ="plain", size =20, color ="black"),axis.text.y =element_text(face ="plain", size =20, color ="black"),axis.title.y =element_text(face ="plain", size =22, color ="black"), axis.title.x =element_text(face ="plain", size =22, color ="black"),legend.position ="bottom",legend.title =element_text(size =22), # Adjusted legend title sizelegend.text =element_text(size =20), # Adjusted legend text sizepanel.grid.major =element_line(color ="gray"),panel.grid.minor =element_blank(),panel.background =element_rect(fill ="white", color ="white"),panel.border =element_rect(color ="black", fill =NA, size =1) ) +coord_cartesian(ylim =c(1, 7)) # Adjusted y limits to match scale_y_continuous# Print the plotprint(motivateP)
Plot by Pol Group
Composite
7 point agreement scale
Code
motivateP_polGroup <-ggplot(gjg_long, aes(x = companyLeaning, y = OMotivate, color = signal)) +geom_point(stat ="summary", fun ="mean", size =4, position =position_dodge(width =0.25)) +# Increased point sizestat_summary(fun.data ="mean_cl_normal", geom ="errorbar", position =position_dodge(width =0.25), width =0.2, size =1.5) +# Increased error bar sizegeom_hline(yintercept =4, linetype ="dashed", color ="black", size = .7, alpha =0.4) +scale_x_discrete(labels =c("Liberal", "Conservative")) +scale_y_continuous(breaks =c(1, 2, 3, 4, 5, 6, 7), labels =c("-3","-2","-1", "0", "1", "2", "3"), ) +scale_color_manual(values =c("N"="#B550B5", "S"="#00C957"),labels =c("Consistent", "Inconsistent"),name ="Company Political Leaning \n\ & Signal") +labs(x ="Condition", y ="Belief that the post motivates support from others", title ="" ) +theme_minimal(base_size =15) +theme(plot.title =element_text(hjust =0.5, size =25),axis.text.x =element_text(face ="plain", size =20, color ="black"),axis.text.y =element_text(face ="plain", size =20, color ="black"),axis.title.y =element_text(face ="plain", size =22, color ="black"), axis.title.x =element_text(face ="plain", size =22, color ="black"),legend.position ="bottom",legend.title =element_text(size =22), # Adjusted legend title sizelegend.text =element_text(size =20), # Adjusted legend text sizepanel.grid.major =element_line(color ="gray"),panel.grid.minor =element_blank(),panel.background =element_rect(fill ="white", color ="white"),panel.border =element_rect(color ="black", fill =NA, size =1) ) +facet_wrap("political_group") +coord_cartesian(ylim =c(1, 7)) # Adjusted y limits to match scale_y_continuous# Print the plotprint(motivateP_polGroup)
Line by Pol
Code
ggplot(gjg_long, aes(x = pol, y = OMotivate, color = condition)) +stat_summary(fun.data ="mean_cl_normal", geom ="line") +geom_hline(yintercept =4, linetype ="dashed", color ="black", size = .7, alpha =0.4) +# geom_point(position = position_jitter(width = 0.1, height = 0.1), alpha = 0.2) +labs(x ="Participant Political Leaning \n\ (Conservative to Liberal)", y ="Belief that the post motivates support from others", color ="Company Political Leaning \n\ & Signal", title ="Belief that the post motivates support from others") +coord_cartesian(ylim =c(1, 7)) +scale_y_continuous(breaks =c(1,2,3,4,5,6,7))
Static Norm
Main Plot
Code
staticP <-ggplot(gjg_long, aes(x = companyLeaning, y = staticNorm, color = signal)) +geom_point(stat ="summary", fun ="mean", size =4, position =position_dodge(width =0.25)) +# Increased point sizestat_summary(fun.data ="mean_cl_normal", geom ="errorbar", position =position_dodge(width =0.25), width =0.2, size =1.5) +# Increased error bar sizescale_x_discrete(labels =c("Liberal", "Conservative")) +scale_y_continuous(breaks =c(25, 50, 75, 100) ) +scale_color_manual(values =c("N"="#B550B5", "S"="#00C957"),labels =c("Consistent", "Inconsistent"),name ="Company Political Leaning \n\ & Signal") +labs(x ="Condition", y ="Percent of Americans that support the cause", title ="Participant Perception of Social Cause Support" ) +theme_minimal(base_size =15) +theme(plot.title =element_text(hjust =0.5, size =25),axis.text.x =element_text(face ="plain", size =20, color ="black"),axis.text.y =element_text(face ="plain", size =20, color ="black"),axis.title.y =element_text(face ="plain", size =22, color ="black"), axis.title.x =element_text(face ="plain", size =22, color ="black"),legend.position ="bottom",legend.title =element_text(size =22), # Adjusted legend title sizelegend.text =element_text(size =20), # Adjusted legend text sizepanel.grid.major =element_line(color ="gray"),panel.grid.minor =element_blank(),panel.background =element_rect(fill ="white", color ="white"),panel.border =element_rect(color ="black", fill =NA, size =1) ) +coord_cartesian(ylim =c(1, 100)) # Adjusted y limits to match scale_y_continuous# Print the plotprint(staticP)
Plot by Pol Group
Composite
7 point agreement scale
Code
staticP_polGroup <-ggplot(gjg_long, aes(x = companyLeaning, y = staticNorm, color = signal)) +geom_point(stat ="summary", fun ="mean", size =4, position =position_dodge(width =0.25)) +# Increased point sizestat_summary(fun.data ="mean_cl_normal", geom ="errorbar", position =position_dodge(width =0.25), width =0.2, size =1.5) +# Increased error bar sizescale_x_discrete(labels =c("Liberal", "Conservative")) +scale_y_continuous(breaks =c(25, 50, 75, 100) ) +scale_color_manual(values =c("N"="#B550B5", "S"="#00C957"),labels =c("Consistent", "Inconsistent"),name ="Company Political Leaning \n\ & Signal") +labs(x ="Condition", y ="Percent of Americans that support the cause", title ="Participant Perception of Social Cause Support" ) +theme_minimal(base_size =15) +theme(plot.title =element_text(hjust =0.5, size =25),axis.text.x =element_text(face ="plain", size =20, color ="black"),axis.text.y =element_text(face ="plain", size =20, color ="black"),axis.title.y =element_text(face ="plain", size =22, color ="black"), axis.title.x =element_text(face ="plain", size =22, color ="black"),legend.position ="bottom",legend.title =element_text(size =22), # Adjusted legend title sizelegend.text =element_text(size =20), # Adjusted legend text sizepanel.grid.major =element_line(color ="gray"),panel.grid.minor =element_blank(),panel.background =element_rect(fill ="white", color ="white"),panel.border =element_rect(color ="black", fill =NA, size =1) ) +facet_wrap("political_group") +coord_cartesian(ylim =c(1, 100)) # Adjusted y limits to match scale_y_continuous# Print the plotprint(staticP_polGroup)
Line by Pol
Code
ggplot(gjg_long, aes(x = pol, y = staticNorm, color = condition)) +stat_summary(fun.data ="mean_cl_normal", geom ="line") +# geom_point(position = position_jitter(width = 0.1, height = 0.1), alpha = 0.2) +labs(x ="Participant Political Leaning \n\ (Conservative to Liberal)", y ="Belief that the post motivates support from others", color ="Company Political Leaning \n\ & Signal", title ="Belief that the post motivates support from others") +coord_cartesian(ylim =c(1, 100)) +scale_y_continuous(breaks =c(25, 50, 75, 100))
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: staticNorm ~ companyLeaning * signal * pol + (1 | prolificID) +
(1 | social_issue)
Data: gjg_long
REML criterion at convergence: 26078.7
Scaled residuals:
Min 1Q Median 3Q Max
-3.1269 -0.5861 0.0432 0.5807 3.5884
Random effects:
Groups Name Variance Std.Dev.
prolificID (Intercept) 150.7 12.28
social_issue (Intercept) 116.9 10.81
Residual 198.0 14.07
Number of obs: 3076, groups: prolificID, 769; social_issue, 4
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 41.5687 5.6647 3.5992 7.338 0.00274
companyLeaningRight 2.7294 1.8021 2298.0229 1.515 0.13003
signalS 0.2611 1.8014 2298.0143 0.145 0.88475
pol 3.2210 0.3774 1967.1604 8.535 < 2e-16
companyLeaningRight:signalS 1.8065 2.5486 2298.0229 0.709 0.47852
companyLeaningRight:pol -0.5295 0.4025 2298.0284 -1.316 0.18842
signalS:pol 0.2158 0.4022 2298.0168 0.537 0.59161
companyLeaningRight:signalS:pol -0.5089 0.5692 2298.0284 -0.894 0.37132
(Intercept) **
companyLeaningRight
signalS
pol ***
companyLeaningRight:signalS
companyLeaningRight:pol
signalS:pol
companyLeaningRight:signalS:pol
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Correlation of Fixed Effects:
(Intr) cmpnLR signlS pol cmLR:S cmpLR: sgnlS:
cmpnyLnngRg -0.159
signalS -0.159 0.500
pol -0.274 0.489 0.489
cmpnyLnnR:S 0.112 -0.707 -0.707 -0.346
cmpnyLnngR: 0.146 -0.917 -0.459 -0.533 0.649
signalS:pol 0.146 -0.459 -0.917 -0.533 0.649 0.500
cmpnyLnR:S: -0.103 0.649 0.649 0.377 -0.917 -0.707 -0.708
Dynamic Norm
Main Plot
Code
dyP <-ggplot(gjg_long, aes(x = companyLeaning, y = dyNorm, color = signal)) +geom_point(stat ="summary", fun ="mean", size =4, position =position_dodge(width =0.25)) +# Increased point sizestat_summary(fun.data ="mean_cl_normal", geom ="errorbar", position =position_dodge(width =0.25), width =0.2, size =1.5) +# Increased error bar sizegeom_hline(yintercept =4, linetype ="dashed", color ="black", size = .7, alpha =0.4) +scale_x_discrete(labels =c("Liberal", "Conservative")) +scale_y_continuous(breaks =c(1, 2, 3, 4, 5, 6, 7), labels =c("-3","-2","-1", "0", "1", "2", "3"), ) +scale_color_manual(values =c("N"="#B550B5", "S"="#00C957"),labels =c("Consistent", "Inconsistent"),name ="signal") +labs(x ="Condition", y ="Rate at which support is changing", title ="Perception of Norm Change" ) +theme_minimal(base_size =15) +theme(plot.title =element_text(hjust =0.5, size =25),axis.text.x =element_text(face ="plain", size =20, color ="black"),axis.text.y =element_text(face ="plain", size =20, color ="black"),axis.title.y =element_text(face ="plain", size =22, color ="black"), axis.title.x =element_text(face ="plain", size =22, color ="black"),legend.position ="bottom",legend.title =element_text(size =22), # Adjusted legend title sizelegend.text =element_text(size =20), # Adjusted legend text sizepanel.grid.major =element_line(color ="gray"),panel.grid.minor =element_blank(),panel.background =element_rect(fill ="white", color ="white"),panel.border =element_rect(color ="black", fill =NA, size =1) ) +coord_cartesian(ylim =c(1, 7)) # Adjusted y limits to match scale_y_continuous# Print the plotprint(dyP)
Plot by Pol Group
Composite
7 point agreement scale
Code
dyP_polGroup <-ggplot(gjg_long, aes(x = companyLeaning, y = dyNorm, color = signal)) +geom_point(stat ="summary", fun ="mean", size =4, position =position_dodge(width =0.25)) +# Increased point sizestat_summary(fun.data ="mean_cl_normal", geom ="errorbar", position =position_dodge(width =0.25), width =0.2, size =1.5) +# Increased error bar sizegeom_hline(yintercept =4, linetype ="dashed", color ="black", size = .7, alpha =0.4) +scale_x_discrete(labels =c("Liberal", "Conservative")) +scale_y_continuous(breaks =c(1, 2, 3, 4, 5, 6, 7), labels =c("-3","-2","-1", "0", "1", "2", "3"), ) +scale_color_manual(values =c("N"="#B550B5", "S"="#00C957"),labels =c("Consistent", "Inconsistent"),name ="Company Political Leaning \n\ & Signal") +labs(x ="Condition", y ="Rate at which support is changing", title ="Perception of Norm Change" ) +theme_minimal(base_size =15) +theme(plot.title =element_text(hjust =0.5, size =25),axis.text.x =element_text(face ="plain", size =20, color ="black"),axis.text.y =element_text(face ="plain", size =20, color ="black"),axis.title.y =element_text(face ="plain", size =22, color ="black"), axis.title.x =element_text(face ="plain", size =22, color ="black"),legend.position ="bottom",legend.title =element_text(size =22), # Adjusted legend title sizelegend.text =element_text(size =20), # Adjusted legend text sizepanel.grid.major =element_line(color ="gray"),panel.grid.minor =element_blank(),panel.background =element_rect(fill ="white", color ="white"),panel.border =element_rect(color ="black", fill =NA, size =1) ) +facet_wrap("political_group") +coord_cartesian(ylim =c(1, 7)) # Adjusted y limits to match scale_y_continuous# Print the plotprint(dyP_polGroup)
Line by Pol
Code
ggplot(gjg_long, aes(x = pol, y = dyNorm, color = condition)) +stat_summary(fun.data ="mean_cl_normal", geom ="line") +geom_hline(yintercept =4, linetype ="dashed", color ="black", size = .7, alpha =0.4) +# geom_point(position = position_jitter(width = 0.1, height = 0.1), alpha = 0.2) +labs(x ="Participant Political Leaning \n\ (Conservative to Liberal)", y ="Belief that the post motivates support from others", color ="Company Political Leaning \n\ & Signal", title ="Belief that the post motivates support from others") +coord_cartesian(ylim =c(1, 7)) +scale_y_continuous(breaks =c(1,2,3,4,5,6,7))