library("pwr")
library("car")
library("brms")
library("patchwork")
library("knitr") # for RMarkdown commands
library("kableExtra") # for nice tables
library("tidyverse")
# set ggplot theme
theme_set(theme_classic())
# set knitr options
$set(comment = "",
opts_chunkfig.show = "hold")
# suppress summarise() grouping warning
options(dplyr.summarise.inform = F)
# # Read in demographics data
<- read.csv(file="../../data/wilful_ignorance_full_study_1-participants.csv") %>%
participants select(-c(proliferate.condition, error))
# # Read in response data
<- read.csv(file="../../data/wilful_ignorance_full_study_1-responses.csv") %>%
responses select(-c(proliferate.condition, error))
# # Merge datafiles
<- merge(responses, participants, by="workerid") Data1.df
# # New columns with condition information
<- Data1.df %>%
Exp1.df gather("index", "value", -c(workerid, condition, age, ethnicity, gender, feedback, race))%>%
mutate(scenario_order =
case_when(
str_detect(index, "1") ~ "1",
str_detect(index, "2") ~ "2",
str_detect(index, "3") ~ "3",
str_detect(index, "4") ~ "4",
%>%
)) mutate(index =
case_when(
str_detect(index, "_response_first") ~ "responsibility_rating",
str_detect(index, "_response_second") ~ "belief_rating",
str_detect(index, "scenario") ~ "scenario") ## order important, do not change
%>%
) spread(index, value) %>%
mutate(EpistemicCondition =
case_when(
== "condition1" & scenario == "sunscreen"~ "Willful\nIgnorance",
condition == "condition1" & scenario == "laundry"~ "Unintentional\nIgnorance",
condition == "condition1" & scenario == "paint"~ "Willful\nKnowledge",
condition == "condition1" & scenario == "fertilizer"~ "Unintentional\nKnowledge",
condition == "condition2" & scenario == "sunscreen"~ "Unintentional\nKnowledge",
condition == "condition2" & scenario == "laundry"~ "Willful\nKnowledge",
condition == "condition2" & scenario == "paint"~ "Willful\nIgnorance",
condition == "condition2" & scenario == "fertilizer"~ "Unintentional\nIgnorance",
condition == "condition3" & scenario == "sunscreen"~ "Unintentional\nIgnorance",
condition == "condition3" & scenario == "laundry"~ "Willful\nIgnorance",
condition == "condition3" & scenario == "paint"~ "Unintentional\nKnowledge",
condition == "condition3" & scenario == "fertilizer"~ "Willful\nKnowledge",
condition == "condition4" & scenario == "sunscreen"~ "Willful\nKnowledge",
condition == "condition4" & scenario == "laundry"~ "Unintentional\nKnowledge",
condition == "condition4" & scenario == "paint"~ "Unintentional\nIgnorance",
condition == "condition4" & scenario == "fertilizer"~ "Willful\nIgnorance")) %>%
condition mutate(EpistemicCondition= factor(EpistemicCondition, levels=c("Unintentional\nIgnorance", "Willful\nIgnorance", "Unintentional\nKnowledge", "Willful\nKnowledge"))) %>%
mutate(Knowledge =
case_when(
== "Willful\nIgnorance" | EpistemicCondition == "Unintentional\nIgnorance" ~ "Ignorance",
EpistemicCondition == "Willful\nKnowledge" | EpistemicCondition == "Unintentional\nKnowledge" ~ "Knowledge")) %>%
EpistemicCondition mutate(Intentionality =
case_when(
== "Willful\nIgnorance" | EpistemicCondition == "Willful\nKnowledge" ~ "Intentional",
EpistemicCondition == "Unintentional\nKnowledge" | EpistemicCondition == "Unintentional\nIgnorance" ~ "Unintentional")) %>%
EpistemicCondition mutate(Knowledge= factor(Knowledge, levels=c("Knowledge", "Ignorance"))) %>%
mutate(Intentionality= factor(Intentionality, levels=c("Intentional", "Unintentional"))) %>%
mutate(responsibility_rating = as.numeric(responsibility_rating)) %>%
mutate(belief_rating = as.numeric(belief_rating))
<-Data1.df%>%
Data1_demo.df summarise(n=n(),
mean_age = mean(age),
std_age=sd(age),
female=sum(gender=="Female"),
male=sum(gender=="Male"),
non_binary=sum(gender=="Non-binary"),
asian=sum(race=="Asian"),
white=sum(race=="White"),
black=sum(race=="Black/African American"),
multi=sum(race=="Multiracial"),
hawai=sum(race=="Native Hawaiian/Pacific Islander"),
other=sum(race=="other_race")
)
<-Exp1.df%>%
Data1_desc.df group_by(Knowledge, Intentionality) %>%
summarize(mean_resp = mean(responsibility_rating),
sd_resp = sd(responsibility_rating),
mean_belief = mean(belief_rating),
sd_belief = sd(belief_rating))
contrasts(Exp1.df$Knowledge) = contr.sum(2)
contrasts(Exp1.df$Intentionality) = contr.sum(2)
= brm(formula = responsibility_rating ~ 1 + Knowledge*Intentionality + (1 | workerid) + (1 | scenario),
fit_responsibility_judgment data = Exp1.df,
seed = 1,
cores = 2,
file = "cache/fit_responsibility_judgment")
summary(fit_responsibility_judgment)
Family: gaussian
Links: mu = identity; sigma = identity
Formula: responsibility_rating ~ 1 + Knowledge * Intentionality + (1 | workerid) + (1 | scenario)
Data: Exp1.df (Number of observations: 804)
Draws: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
total post-warmup draws = 4000
Group-Level Effects:
~scenario (Number of levels: 4)
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept) 0.10 0.12 0.00 0.42 1.00 1858 1748
~workerid (Number of levels: 201)
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept) 1.15 0.09 0.98 1.33 1.00 1515 2592
Population-Level Effects:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS
Intercept 8.24 0.12 8.01 8.48 1.00 1389
Knowledge1 1.15 0.06 1.03 1.27 1.00 5746
Intentionality1 0.42 0.06 0.30 0.54 1.00 5611
Knowledge1:Intentionality1 -0.43 0.06 -0.54 -0.31 1.00 5153
Tail_ESS
Intercept 1701
Knowledge1 2793
Intentionality1 2287
Knowledge1:Intentionality1 2909
Family Specific Parameters:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sigma 1.66 0.05 1.57 1.76 1.00 2620 2913
Draws were sampled using sampling(NUTS). For each parameter, Bulk_ESS
and Tail_ESS are effective sample size measures, and Rhat is the potential
scale reduction factor on split chains (at convergence, Rhat = 1).
= brm(formula = belief_rating ~ 1 + Knowledge*Intentionality + (1 | workerid) + (1 | scenario),
fit_belief_judgment data = Exp1.df,
seed = 1,
cores = 2,
file = "cache/fit_belief_judgment")
fit_belief_judgment
Family: gaussian
Links: mu = identity; sigma = identity
Formula: belief_rating ~ 1 + Knowledge * Intentionality + (1 | workerid) + (1 | scenario)
Data: Exp1.df (Number of observations: 804)
Draws: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
total post-warmup draws = 4000
Group-Level Effects:
~scenario (Number of levels: 4)
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept) 0.21 0.26 0.01 0.89 1.00 766 628
~workerid (Number of levels: 201)
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept) 1.16 0.11 0.95 1.39 1.00 1506 2104
Population-Level Effects:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS
Intercept 6.00 0.17 5.66 6.35 1.00 1051
Knowledge1 2.76 0.07 2.62 2.91 1.00 5712
Intentionality1 0.42 0.07 0.28 0.56 1.00 5804
Knowledge1:Intentionality1 -0.38 0.08 -0.53 -0.23 1.00 5704
Tail_ESS
Intercept 807
Knowledge1 2535
Intentionality1 3003
Knowledge1:Intentionality1 2500
Family Specific Parameters:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sigma 2.13 0.06 2.01 2.26 1.00 2828 2958
Draws were sampled using sampling(NUTS). For each parameter, Bulk_ESS
and Tail_ESS are effective sample size measures, and Rhat is the potential
scale reduction factor on split chains (at convergence, Rhat = 1).
<- theme(axis.title.x = element_blank(),
myTheme axis.title.y = element_text(color="black", size = 16, vjust=.9),
axis.text.x = element_text(color="black", size = 15),
axis.text.y = element_text(color="black", size = 18),
strip.text.x = element_text(color="black", size = 20),
legend.text = element_text(color="black", size = 18),
legend.title = element_text(color="black", size = 18),
legend.position = "top",
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
strip.background = element_rect(fill="white"))
<- Exp1.df %>%
Fig1a ggplot(aes(x=EpistemicCondition, y=responsibility_rating, group=EpistemicCondition, fill=EpistemicCondition)) +
coord_cartesian(ylim = c(0,10)) +
scale_y_continuous(breaks = seq(0, 10, by=1))+
stat_summary(fun = mean, geom = "bar", colour = "black", alpha=0.7) +
stat_summary(fun.data = mean_cl_boot, geom = "linerange", width = 1, size=1) +
geom_jitter(position = position_jitter(height = 0.2, width=0.15), alpha =
0.06, colour="black")+
labs( y="Responsibility Rating")+
scale_fill_brewer(palette="Paired")+
scale_color_brewer(palette="Paired")+
guides(fill = FALSE, colour = FALSE) +
theme_bw()+
myTheme
#Show plot
plot(Fig1a)
ggsave(Fig1a, file="Fig1a.pdf", dpi=400, height = 4, width = 7)
<- RColorBrewer::brewer.pal(12, "Paired")[5:8]
my_colors
<- Exp1.df %>%
Fig1b ggplot(aes(x=EpistemicCondition, y=belief_rating, group=EpistemicCondition, fill=EpistemicCondition)) +
coord_cartesian(ylim = c(0,10)) +
scale_y_continuous(breaks = seq(0, 10, by=1))+
stat_summary(fun = mean, geom = "bar", colour = "black", alpha=0.5) +
stat_summary(fun.data = mean_cl_boot, geom = "linerange", width = 1, size=1) +
geom_jitter(position = position_jitter(height = 0.2, width=0.15), alpha =
0.06, colour="black")+
labs( y="Belief Rating")+
scale_fill_manual(values=my_colors)+
guides(fill = FALSE, colour = FALSE) +
theme_bw()+
myTheme
Warning: Ignoring unknown parameters: width
Warning: `guides(<scale> = FALSE)` is deprecated. Please use `guides(<scale> =
"none")` instead.
#Show plot
plot(Fig1b)
#ggsave(Fig1b, file="Fig1b.pdf", height = 4, width = 7)
+ Fig1b +
Fig1a plot_layout(ncol = 1) +
plot_annotation(tag_levels = "A") &
theme(plot.tag = element_text(face = 'bold', size = 20))
ggsave(file="../../figures/plots/experiment1.pdf",
height = 8,
width = 6)
# # Read in demographics data
# # Read data
<- read.csv(file="../../data/willful_ignorance_full_study_2-participants.csv") %>%
participants2 select(-c(proliferate.condition, error))
<- read.csv(file="../../data/willful_ignorance_full_study_3-participants.csv") %>%
participants3 select(-c(proliferate.condition, error))
# # Read in response data
<- read.csv(file="../../data/willful_ignorance_full_study_2-responses.csv") %>%
responses2 select(-c(proliferate.condition, error))
<- read.csv(file="../../data/willful_ignorance_full_study_3-responses.csv") %>%
responses3 select(-c(proliferate.condition, error,
ignorance_scenario1, ignorance_scenario2,
ignorance_scenario1_response_counterfactual,
ignorance_scenario2_response_counterfactual))
# # Merge datafiles
<- merge(responses2, participants2, by="workerid")
Data2a.df <- merge(responses3, participants3, by="workerid")
Data2b.df $uncertainty <- "medium"
Data2a.df$uncertainty <- "high"
Data2b.df<- rbind(Data2a.df, Data2b.df) Data2.df
# # New columns with condition information
<- Data2.df %>%
Exp2.df gather("index", "value", -c(workerid, condition, age, ethnicity, gender, feedback, race, uncertainty))%>%
mutate(scenario_order =
case_when(
str_detect(index, "1") ~ "1",
str_detect(index, "2") ~ "2",
str_detect(index, "3") ~ "3",
str_detect(index, "4") ~ "4",
%>%
)) mutate(index =
case_when(
str_detect(index, "_response_first") ~ "responsibility_rating",
str_detect(index, "_response_second") ~ "belief_rating",
str_detect(index, "scenario") ~ "scenario") ## order important, do not change
%>%
) spread(index, value) %>%
mutate(EpistemicCondition =
case_when(
== "condition1" & scenario == "sunscreen"~ "Willful\nIgnorance",
condition == "condition1" & scenario == "laundry"~ "Unintentional\nIgnorance",
condition == "condition1" & scenario == "paint"~ "Willful\nKnowledge",
condition == "condition1" & scenario == "fertilizer"~ "Unintentional\nKnowledge",
condition == "condition2" & scenario == "sunscreen"~ "Unintentional\nKnowledge",
condition == "condition2" & scenario == "laundry"~ "Willful\nKnowledge",
condition == "condition2" & scenario == "paint"~ "Willful\nIgnorance",
condition == "condition2" & scenario == "fertilizer"~ "Unintentional\nIgnorance",
condition == "condition3" & scenario == "sunscreen"~ "Unintentional\nIgnorance",
condition == "condition3" & scenario == "laundry"~ "Willful\nIgnorance",
condition == "condition3" & scenario == "paint"~ "Unintentional\nKnowledge",
condition == "condition3" & scenario == "fertilizer"~ "Willful\nKnowledge",
condition == "condition4" & scenario == "sunscreen"~ "Willful\nKnowledge",
condition == "condition4" & scenario == "laundry"~ "Unintentional\nKnowledge",
condition == "condition4" & scenario == "paint"~ "Unintentional\nIgnorance",
condition == "condition4" & scenario == "fertilizer"~ "Willful\nIgnorance")) %>%
condition mutate(EpistemicCondition= factor(EpistemicCondition, levels=c("Unintentional\nIgnorance", "Willful\nIgnorance", "Unintentional\nKnowledge", "Willful\nKnowledge"))) %>%
mutate(Knowledge =
case_when(
== "Willful\nIgnorance" | EpistemicCondition == "Unintentional\nIgnorance" ~ "Ignorance",
EpistemicCondition == "Willful\nKnowledge" | EpistemicCondition == "Unintentional\nKnowledge" ~ "Knowledge")) %>%
EpistemicCondition mutate(Intentionality =
case_when(
== "Willful\nIgnorance" | EpistemicCondition == "Willful\nKnowledge" ~ "Intentional",
EpistemicCondition == "Unintentional\nKnowledge" | EpistemicCondition == "Unintentional\nIgnorance" ~ "Unintentional")) %>%
EpistemicCondition mutate(EpistemicCondition =
case_when(
== "Willful\nIgnorance" ~ "WI",
EpistemicCondition == "Unintentional\nIgnorance" ~ "UI",
EpistemicCondition == "Willful\nKnowledge" ~ "WK",
EpistemicCondition == "Unintentional\nKnowledge" ~ "UK")) %>%
EpistemicCondition mutate(EpistemicCondition= factor(EpistemicCondition, levels=c("UI", "WI", "UK", "WK"))) %>%
mutate(uncertainty, as.factor(uncertainty)) %>%
mutate(Uncertainty = recode_factor(uncertainty,
medium = "Ignorance: 50%, Knowledge: 100%",
high = "Ignorance: 20%, Knowledge: 100%")) %>%
mutate(Intentionality= factor(Intentionality,
levels=c("Intentional", "Unintentional"))) %>%
mutate(responsibility_rating = as.numeric(responsibility_rating)) %>%
mutate(belief_rating = as.numeric(belief_rating)) %>%
mutate(Knowledge = as.factor(Knowledge)) %>%
mutate(Intentionality = as.factor(Intentionality))
##Demographics
<-Data2.df%>%
Data2_demo.df summarise(n=n(),
mean_age = mean(age, na.rm=TRUE),
std_age=sd(age,na.rm=TRUE),
female=sum(gender=="Female"),
male=sum(gender=="Male"),
non_binary=sum(gender=="Non-binary"),
asian=sum(race=="Asian"),
white=sum(race=="White"),
black=sum(race=="Black/African American"),
multi=sum(race=="Multiracial"),
hawai=sum(race=="Native Hawaiian/Pacific Islander"),
other=sum(race=="other_race")
)
<-Exp2.df%>%
Data2_desc.df group_by(Knowledge, Intentionality) %>%
summarize(mean_resp = mean(responsibility_rating),
sd_resp = sd(responsibility_rating),
mean_belief = mean(belief_rating),
sd_belief = sd(belief_rating))
##Analysis
contrasts(Exp2.df$Knowledge) = contr.sum(2)
contrasts(Exp2.df$Intentionality) = contr.sum(2)
= brm(formula = responsibility_rating ~ 1 + Knowledge*Intentionality + (1 | workerid) + (1 | scenario),
fit_responsibility_judgment data = Exp2.df,
seed = 1,
cores = 2,
file = "cache/fit_responsibility_judgment")
summary(fit_responsibility_judgment)
Family: gaussian
Links: mu = identity; sigma = identity
Formula: responsibility_rating ~ 1 + Knowledge * Intentionality + (1 | workerid) + (1 | scenario)
Data: Exp1.df (Number of observations: 804)
Draws: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
total post-warmup draws = 4000
Group-Level Effects:
~scenario (Number of levels: 4)
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept) 0.10 0.12 0.00 0.42 1.00 1858 1748
~workerid (Number of levels: 201)
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept) 1.15 0.09 0.98 1.33 1.00 1515 2592
Population-Level Effects:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS
Intercept 8.24 0.12 8.01 8.48 1.00 1389
Knowledge1 1.15 0.06 1.03 1.27 1.00 5746
Intentionality1 0.42 0.06 0.30 0.54 1.00 5611
Knowledge1:Intentionality1 -0.43 0.06 -0.54 -0.31 1.00 5153
Tail_ESS
Intercept 1701
Knowledge1 2793
Intentionality1 2287
Knowledge1:Intentionality1 2909
Family Specific Parameters:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sigma 1.66 0.05 1.57 1.76 1.00 2620 2913
Draws were sampled using sampling(NUTS). For each parameter, Bulk_ESS
and Tail_ESS are effective sample size measures, and Rhat is the potential
scale reduction factor on split chains (at convergence, Rhat = 1).
= brm(formula = belief_rating ~ 1 + Knowledge*Intentionality + (1 | workerid) + (1 | scenario),
fit_belief_judgment data = Exp2.df,
seed = 1,
cores = 2,
file = "cache/fit_belief_judgment")
fit_belief_judgment
Family: gaussian
Links: mu = identity; sigma = identity
Formula: belief_rating ~ 1 + Knowledge * Intentionality + (1 | workerid) + (1 | scenario)
Data: Exp1.df (Number of observations: 804)
Draws: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
total post-warmup draws = 4000
Group-Level Effects:
~scenario (Number of levels: 4)
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept) 0.21 0.26 0.01 0.89 1.00 766 628
~workerid (Number of levels: 201)
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept) 1.16 0.11 0.95 1.39 1.00 1506 2104
Population-Level Effects:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS
Intercept 6.00 0.17 5.66 6.35 1.00 1051
Knowledge1 2.76 0.07 2.62 2.91 1.00 5712
Intentionality1 0.42 0.07 0.28 0.56 1.00 5804
Knowledge1:Intentionality1 -0.38 0.08 -0.53 -0.23 1.00 5704
Tail_ESS
Intercept 807
Knowledge1 2535
Intentionality1 3003
Knowledge1:Intentionality1 2500
Family Specific Parameters:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sigma 2.13 0.06 2.01 2.26 1.00 2828 2958
Draws were sampled using sampling(NUTS). For each parameter, Bulk_ESS
and Tail_ESS are effective sample size measures, and Rhat is the potential
scale reduction factor on split chains (at convergence, Rhat = 1).
<- Exp2.df %>%
Exp2b.df filter(Knowledge == "Ignorance") %>%
mutate(Uncertainty=as.factor(Uncertainty))
#set contrasts
contrasts(Exp2b.df$Uncertainty) = contr.sum(2)
= brm(formula = responsibility_rating ~ 1 + Uncertainty + (1 | workerid) + (1 | scenario),
fit_responsibility_judgment_uncertain data = Exp2b.df,
seed = 1,
cores = 2,
file = "cache/fit_responsibility_judgment")
fit_responsibility_judgment_uncertain
Family: gaussian
Links: mu = identity; sigma = identity
Formula: responsibility_rating ~ 1 + Knowledge * Intentionality + (1 | workerid) + (1 | scenario)
Data: Exp1.df (Number of observations: 804)
Draws: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
total post-warmup draws = 4000
Group-Level Effects:
~scenario (Number of levels: 4)
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept) 0.10 0.12 0.00 0.42 1.00 1858 1748
~workerid (Number of levels: 201)
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept) 1.15 0.09 0.98 1.33 1.00 1515 2592
Population-Level Effects:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS
Intercept 8.24 0.12 8.01 8.48 1.00 1389
Knowledge1 1.15 0.06 1.03 1.27 1.00 5746
Intentionality1 0.42 0.06 0.30 0.54 1.00 5611
Knowledge1:Intentionality1 -0.43 0.06 -0.54 -0.31 1.00 5153
Tail_ESS
Intercept 1701
Knowledge1 2793
Intentionality1 2287
Knowledge1:Intentionality1 2909
Family Specific Parameters:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sigma 1.66 0.05 1.57 1.76 1.00 2620 2913
Draws were sampled using sampling(NUTS). For each parameter, Bulk_ESS
and Tail_ESS are effective sample size measures, and Rhat is the potential
scale reduction factor on split chains (at convergence, Rhat = 1).
= brm(formula = belief_rating ~ 1 + Uncertainty + (1 | workerid) + (1 | scenario),
fit_belief_judgment_uncertain data = Exp2b.df,
seed = 1,
cores = 2,
file = "cache/fit_belief_judgment")
fit_belief_judgment_uncertain
Family: gaussian
Links: mu = identity; sigma = identity
Formula: belief_rating ~ 1 + Knowledge * Intentionality + (1 | workerid) + (1 | scenario)
Data: Exp1.df (Number of observations: 804)
Draws: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
total post-warmup draws = 4000
Group-Level Effects:
~scenario (Number of levels: 4)
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept) 0.21 0.26 0.01 0.89 1.00 766 628
~workerid (Number of levels: 201)
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept) 1.16 0.11 0.95 1.39 1.00 1506 2104
Population-Level Effects:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS
Intercept 6.00 0.17 5.66 6.35 1.00 1051
Knowledge1 2.76 0.07 2.62 2.91 1.00 5712
Intentionality1 0.42 0.07 0.28 0.56 1.00 5804
Knowledge1:Intentionality1 -0.38 0.08 -0.53 -0.23 1.00 5704
Tail_ESS
Intercept 807
Knowledge1 2535
Intentionality1 3003
Knowledge1:Intentionality1 2500
Family Specific Parameters:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sigma 2.13 0.06 2.01 2.26 1.00 2828 2958
Draws were sampled using sampling(NUTS). For each parameter, Bulk_ESS
and Tail_ESS are effective sample size measures, and Rhat is the potential
scale reduction factor on split chains (at convergence, Rhat = 1).
<- read.csv(file="../../data/willful_ignorance_full_study_3-responses.csv")
responses3c
<- merge(responses3c, participants3, by="workerid") %>%
Data2c.df select(workerid:ignorance_scenario2_response_counterfactual) %>%
rename(response_counterfactual_1 = ignorance_scenario1_response_counterfactual) %>%
rename(response_counterfactual_2 = ignorance_scenario2_response_counterfactual)
<- Data2c.df %>%
Exp2c.df select(-c(proliferate.condition, condition)) %>%
pivot_longer(cols = starts_with("response"), names_to = "condition", names_prefix = "counterfactual", values_to = "counterfactual_rating") %>%
mutate(Intentionality =
case_when(
== "response_counterfactual_1" & ignorance_scenario1 == "IntentionalIgnorance"~ "Intentional",
condition == "response_counterfactual_1" & ignorance_scenario1 == "UnintentionalIgnorance"~ "Unintentional",
condition == "response_counterfactual_2" & ignorance_scenario2 == "IntentionalIgnorance"~ "Intentional",
condition == "response_counterfactual_2" & ignorance_scenario2 == "UnintentionalIgnorance"~ "Unintentional")
condition %>%
) mutate(Intentionality= factor(Intentionality, levels=c("Intentional", "Unintentional"))) %>%
mutate(counterfactual_rating = as.numeric(counterfactual_rating))
contrasts(Exp2c.df$Intentionality) = contr.sum(2)
#### Counterfactual Rating
= brm(formula = counterfactual_rating ~ 1 + Intentionality + (1 | workerid),
fit_counterfactual_judgment data = Exp2c.df,
seed = 1,
cores = 2,
file = "cache/fit_counterfactual_judgment")
summary(fit_counterfactual_judgment)
Family: gaussian
Links: mu = identity; sigma = identity
Formula: counterfactual_rating ~ 1 + Intentionality + (1 | workerid)
Data: Exp2c.df (Number of observations: 396)
Draws: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
total post-warmup draws = 4000
Group-Level Effects:
~workerid (Number of levels: 198)
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept) 2.17 0.13 1.93 2.44 1.00 1137 1921
Population-Level Effects:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept 6.01 0.16 5.69 6.34 1.01 879 1643
Intentionality1 0.28 0.06 0.15 0.40 1.00 8000 2810
Family Specific Parameters:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sigma 1.25 0.06 1.13 1.38 1.00 1986 2715
Draws were sampled using sampling(NUTS). For each parameter, Bulk_ESS
and Tail_ESS are effective sample size measures, and Rhat is the potential
scale reduction factor on split chains (at convergence, Rhat = 1).
<- theme(axis.title.x = element_blank(),
myTheme axis.title.y = element_text(color="black", size = 17, vjust=.9),
axis.text.x = element_text(color="black", size = 16),
axis.text.y = element_text(color="black", size = 16),
strip.text.x = element_text(color="black", size = 13),
legend.text = element_text(color="black", size = 12),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
strip.background = element_rect(fill="white"),
legend.title = element_blank()
)
<- Exp2.df %>%
Fig2a ggplot(aes(x=EpistemicCondition, y=responsibility_rating, group=EpistemicCondition, fill=EpistemicCondition)) +
coord_cartesian(ylim = c(0,10)) +
scale_y_continuous(breaks = seq(0, 10, by=1))+
stat_summary(fun = mean, geom = "bar", colour = "black", alpha=0.7) +
stat_summary(fun.data = mean_cl_boot, geom = "linerange", width = 1, size=1) +
geom_jitter(position = position_jitter(height = 0.2, width=0.15), alpha =
0.05, colour="black")+
labs( y="Responsibility Rating")+
scale_fill_brewer(palette="Paired")+
guides(fill = FALSE, colour = FALSE)+
facet_wrap(~Uncertainty)+
theme_bw()+
myTheme
#Show plot
plot(Fig2a)
ggsave(Fig2a, file="Fig2a.pdf", dpi=400, height = 5, width = 8)
<- RColorBrewer::brewer.pal(12, "Paired")[5:8]
my_colors
<- Exp2.df %>%
Fig2b ggplot(aes(x=EpistemicCondition, y=belief_rating, group=EpistemicCondition, fill=EpistemicCondition)) +
coord_cartesian(ylim = c(0,10)) +
scale_y_continuous(breaks = seq(0, 10, by=1))+
stat_summary(fun = mean, geom = "bar", colour = "black", alpha=0.5) +
stat_summary(fun.data = mean_cl_boot, geom = "linerange", width = 1, size=1) +
geom_jitter(position = position_jitter(height = 0.2, width=0.15), alpha =
0.05, colour="black")+
labs( y="Belief Rating")+
scale_fill_manual(values=my_colors)+
guides(fill = FALSE, colour = FALSE) +
facet_wrap(~Uncertainty)+
theme_bw()+
myTheme
#Show plot
plot(Fig2b)
ggsave(Fig2b, file="Fig2b.pdf", dpi=400, height = 5, width = 8)
+ Fig2b +
Fig2a plot_layout(ncol = 1) +
plot_annotation(tag_levels = "A") &
theme(plot.tag = element_text(face = 'bold', size = 22))
ggsave(file="../../figures/plots/experiment2.pdf",
height = 8,
width = 7)
# # Read in demographics data
<- read.csv(file="../../data/willful_ignorance_study_4-participants.csv") %>%
participants select(-c(proliferate.condition, error))
# # Read in response data
<- read.csv(file="../../data/willful_ignorance_study_4-responses.csv") %>%
responses select(-c(proliferate.condition, error))
# # Merge datafiles
<- merge(responses, participants, by="workerid") Data4.df
<-Data4.df%>%
Data4_demo.df summarise(n=n(),
mean_age = mean(age, na.rm=TRUE),
std_age=sd(age,na.rm=TRUE),
female=sum(gender=="Female"),
male=sum(gender=="Male"),
non_binary=sum(gender=="Non-binary"),
asian=sum(race=="Asian"),
white=sum(race=="White"),
black=sum(race=="Black/African American"),
multi=sum(race=="Multiracial"),
hawai=sum(race=="Native Hawaiian/Pacific Islander"),
other=sum(race=="other_race")
)
# # New columns with condition information
<- Data4.df %>%
Exp4.df gather("index", "value", -c(workerid, condition, age, ethnicity, gender, feedback, race))%>%
mutate(scenario_order =
case_when(
str_detect(index, "1") ~ "1",
str_detect(index, "2") ~ "2",
str_detect(index, "3") ~ "3",
str_detect(index, "4") ~ "4",
%>%
)) mutate(index =
case_when(
str_detect(index, "_response_first") ~ "responsibility_rating",
str_detect(index, "_response_second") ~ "belief_rating",
str_detect(index, "scenario") ~ "scenario") ## order important, do not change
%>%
) spread(index, value) %>%
mutate(Ignorance =
case_when(
str_detect(scenario, "unintentional_") ~ "Unintentional\nIgnorance" ,
str_detect(scenario, "intentional_") ~ "Willful\nIgnorance" ,
%>%
)) mutate(Action_Model =
case_when(
str_detect(scenario, "_dependent") ~ "Action Model: Dependent",
str_detect(scenario, "_independent") ~ "Action Model: Independent",
%>%
)) mutate(scenario_type =
case_when(
== "condition1" & scenario == "unintentional_dependent"~ "fertilizer",
condition == "condition1" & scenario == "unintentional_independent"~ "laundry",
condition == "condition1" & scenario == "intentional_dependent" ~ "paint",
condition == "condition1" & scenario == "intentional_independent" ~ "sunscreen",
condition == "condition2" & scenario == "unintentional_dependent"~ "paint",
condition == "condition2" & scenario == "unintentional_independent"~ "fertilizer",
condition == "condition2" & scenario == "intentional_dependent" ~ "laundry",
condition == "condition2" & scenario == "intentional_independent" ~ "paint",
condition == "condition3" & scenario == "intentional_dependent"~ "fertilizer",
condition == "condition3" & scenario == "intentional_independent"~ "laundry",
condition == "condition3" & scenario == "unintentional_dependent" ~ "paint",
condition == "condition3" & scenario == "unintentional_independent" ~ "sunscreen",
condition == "condition4" & scenario == "intentional_independent"~ "fertilizer",
condition == "condition4" & scenario == "unintentional_dependent"~ "laundry",
condition == "condition4" & scenario == "unintentional_independent" ~ "paint",
condition == "condition4" & scenario == "intentional_dependent" ~ "sunscreen"
condition %>%
)) mutate(Ignorance= factor(Ignorance, levels=c("Unintentional\nIgnorance", "Willful\nIgnorance"))) %>%
mutate(Action_Model= factor(Action_Model, levels=c("Action Model: Dependent", "Action Model: Independent"))) %>%
mutate(scenario= factor(scenario, levels=c("unintentional_dependent", "intentional_dependent", "unintentional_independent", "intentional_independent"))) %>%
mutate(responsibility_rating = as.numeric(responsibility_rating)) %>%
mutate(belief_rating = as.numeric(belief_rating))
<-Data1.df%>%
Data1_demo.df summarise(n=n(),
mean_age = mean(age),
std_age=sd(age),
female=sum(gender=="Female"),
non_binary=sum(gender=="Non-binary"))
# print_table()
##################### Analysis
#### Responsibility Rating
contrasts(Exp4.df$Ignorance) = contr.sum(2)
contrasts(Exp4.df$Action_Model) = contr.sum(2)
#### Responsibility Rating
= brm(formula = responsibility_rating ~ 1 + Action_Model*Ignorance + (1 | workerid) + (1 | scenario_type),
fit_responsibility_judgment data = Exp4.df,
seed = 1,
cores = 2)
summary(fit_responsibility_judgment)
Family: gaussian
Links: mu = identity; sigma = identity
Formula: responsibility_rating ~ 1 + Action_Model * Ignorance + (1 | workerid) + (1 | scenario_type)
Data: Exp4.df (Number of observations: 776)
Draws: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
total post-warmup draws = 4000
Group-Level Effects:
~scenario_type (Number of levels: 4)
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept) 0.18 0.18 0.01 0.72 1.00 928 731
~workerid (Number of levels: 194)
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept) 1.34 0.09 1.17 1.54 1.00 1042 1213
Population-Level Effects:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS
Intercept 8.47 0.16 8.16 8.80 1.00 925
Action_Model1 -0.59 0.06 -0.70 -0.47 1.00 2811
Ignorance1 -0.33 0.06 -0.44 -0.21 1.00 4904
Action_Model1:Ignorance1 -0.15 0.06 -0.26 -0.04 1.00 3688
Tail_ESS
Intercept 1011
Action_Model1 2161
Ignorance1 3029
Action_Model1:Ignorance1 2166
Family Specific Parameters:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sigma 1.58 0.05 1.49 1.67 1.00 2080 1320
Draws were sampled using sampling(NUTS). For each parameter, Bulk_ESS
and Tail_ESS are effective sample size measures, and Rhat is the potential
scale reduction factor on split chains (at convergence, Rhat = 1).
#### Belief Rating
= brm(formula = belief_rating ~ 1 + Action_Model*Ignorance + (1 | workerid) + (1 | scenario_type),
fit_belief_judgment data = Exp4.df,
seed = 1,
cores = 2)
summary(fit_belief_judgment)
Family: gaussian
Links: mu = identity; sigma = identity
Formula: belief_rating ~ 1 + Action_Model * Ignorance + (1 | workerid) + (1 | scenario_type)
Data: Exp4.df (Number of observations: 776)
Draws: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
total post-warmup draws = 4000
Group-Level Effects:
~scenario_type (Number of levels: 4)
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept) 0.13 0.15 0.00 0.56 1.01 943 453
~workerid (Number of levels: 194)
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept) 1.02 0.08 0.86 1.18 1.00 1143 2223
Population-Level Effects:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS
Intercept 5.56 0.11 5.34 5.80 1.00 828
Action_Model1 -0.11 0.05 -0.21 -0.01 1.00 3634
Ignorance1 -0.11 0.05 -0.21 -0.01 1.00 3641
Action_Model1:Ignorance1 0.01 0.05 -0.10 0.12 1.00 3433
Tail_ESS
Intercept 555
Action_Model1 3050
Ignorance1 2861
Action_Model1:Ignorance1 1852
Family Specific Parameters:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sigma 1.47 0.04 1.39 1.56 1.00 2205 2618
Draws were sampled using sampling(NUTS). For each parameter, Bulk_ESS
and Tail_ESS are effective sample size measures, and Rhat is the potential
scale reduction factor on split chains (at convergence, Rhat = 1).
<- Exp4.df %>%
Exp4b.df filter(Action_Model == "Action Model: Independent")
= brm(formula = responsibility_rating ~ 1 + Ignorance + (1 | workerid) + (1 | scenario_type),
fit_responsibility_judgment2 data = Exp4b.df,
seed = 1,
cores = 2)
summary(fit_responsibility_judgment2)
Family: gaussian
Links: mu = identity; sigma = identity
Formula: responsibility_rating ~ 1 + Ignorance + (1 | workerid) + (1 | scenario_type)
Data: Exp4b.df (Number of observations: 388)
Draws: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
total post-warmup draws = 4000
Group-Level Effects:
~scenario_type (Number of levels: 4)
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept) 0.29 0.24 0.02 0.92 1.01 744 513
~workerid (Number of levels: 194)
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept) 1.11 0.08 0.95 1.27 1.00 983 1858
Population-Level Effects:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept 9.07 0.20 8.66 9.55 1.02 345 202
Ignorance1 -0.18 0.05 -0.28 -0.07 1.00 1079 374
Family Specific Parameters:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sigma 1.01 0.05 0.91 1.12 1.01 1266 1365
Draws were sampled using sampling(NUTS). For each parameter, Bulk_ESS
and Tail_ESS are effective sample size measures, and Rhat is the potential
scale reduction factor on split chains (at convergence, Rhat = 1).
#### Set Theme
<- theme(axis.title.x = element_blank(),
myTheme axis.title.y = element_text(color="black", size = 18, vjust=.9),
axis.text.x = element_text(color="black", size = 16),
axis.text.y = element_text(color="black", size = 18),
strip.text.x = element_text(color="black", size = 16),
legend.text = element_text(color="black", size = 12),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
strip.background = element_rect(fill="white"),
legend.title = element_blank()
)
<- Exp4.df %>%
Fig3a ggplot(aes(x=Ignorance, y=responsibility_rating, group=Ignorance, fill=Ignorance)) +
coord_cartesian(ylim = c(0,10)) +
scale_y_continuous(breaks = seq(0, 10, by=1))+
stat_summary(fun = mean, geom = "bar", colour = "black", alpha=0.7) +
stat_summary(fun.data = mean_cl_boot, geom = "linerange", width = 1, size=1) +
geom_jitter(position = position_jitter(height = 0.2, width=0.15), alpha =
0.06, colour="black")+
labs( y="Responsibility Rating")+
scale_fill_brewer(palette="Paired")+
guides(fill = FALSE, colour = FALSE)+
facet_wrap(~Action_Model)+
theme_bw()+
myTheme#theme(axis.text.x = element_text(angle = 15, hjust = 1, color="black", size = 14))
#Show plot
plot(Fig3a)
ggsave(Fig3a, file="Fig3a.pdf", dpi=400, height = 4, width = 7)
<- RColorBrewer::brewer.pal(12, "Paired")[5:6]
my_colors
<- Exp4.df %>%
Fig3b ggplot(aes(x=Ignorance, y=belief_rating, group=Ignorance, fill=Ignorance)) +
coord_cartesian(ylim = c(0,10)) +
scale_y_continuous(breaks = seq(0, 10, by=1))+
stat_summary(fun = mean, geom = "bar", colour = "black", alpha=0.7) +
stat_summary(fun.data = mean_cl_boot, geom = "linerange", width = 1, size=1) +
geom_jitter(position = position_jitter(height = 0.2, width=0.15), alpha =
0.06, colour="black")+
labs( y="Belief Rating")+
scale_fill_manual(values=my_colors)+
guides(fill = FALSE, colour = FALSE)+
facet_wrap(~Action_Model)+
theme_bw()+
myTheme#theme(axis.text.x = element_text(angle = 15, hjust = 1, color="black", size = 14))
#Show plot
plot(Fig3b)
ggsave(Fig3b, file="Fig3b.pdf", dpi=400, height = 4, width = 7)
+ Fig3b +
Fig3a plot_layout(ncol = 1) +
plot_annotation(tag_levels = "A") &
theme(plot.tag = element_text(face = 'bold', size = 22))
ggsave(file="../../figures/plots/experiment3.pdf",
height = 8,
width = 7)