knitr::opts_chunk$set(message=FALSE, warning = FALSE)
library(tidyverse)
library(here)
library(langcog)
library(tidyboot)
source(here("visualization_helper/R_rainclouds.R"))

tidy_d <- read_csv(here("data/4_processed/with_human_coded_main.csv"))
demog_province <- read_csv(here("data/4_processed/demog_state.csv"))
tidy_d <- tidy_d %>% 
  left_join(demog_province, by = c("subject", "culture"))

Descriptives

tidy_d %>% 
  group_by(subject, culture) %>%
  summarise(n = n()) %>%
  group_by(culture) %>%
  count()
## # A tibble: 2 × 2
## # Groups:   culture [2]
##   culture     n
##   <chr>   <int>
## 1 CN        173
## 2 US        296

Free Description

FD_raw <- tidy_d %>% 
  filter(task_name == "FD") %>% 
  group_by(subject, culture) %>%
  summarise(first_mention = mean(as.numeric(resp)))

ggplot(data = FD_raw, 
       aes(y = first_mention, x = culture, fill = culture)) +
geom_flat_violin(position = position_nudge(x = .1, y = 0), alpha = .8) +
geom_point(aes(y = first_mention, color = culture), 
           position = position_jitter(width = .15), size = .5, alpha = 0.8) +
geom_boxplot(width = .1, alpha = 0.3) +
scale_y_continuous(breaks = seq(0,1,0.5), 
                     labels = {function(x) paste0(as.character(x*100),"%")})+
scale_color_manual(values = c("red", "blue"))+
scale_fill_manual(values = c("red", "blue"))+
guides(fill = "none") +
guides(color = "none") +
ylab("proportion first mention focal") + 
xlab("") +
theme_classic() + 
labs(title = "Free description") +
theme(plot.title = element_text(hjust = 0.5, size = 8), 
      plot.subtitle = element_text(hjust = 0.5, size = 6), 
      text = element_text(size=8))

within country

CN

FD_raw <- tidy_d %>% 
  filter(task_name == "FD") %>% 
  filter(culture == "CN") %>% 
  group_by(subject, rice_cat) %>%
  summarise(first_mention = mean(as.numeric(resp))) %>% 
  mutate(rice_cat = ifelse(rice_cat == 1, "wheat", "rice"))


ggplot(data = FD_raw, 
       aes(y = first_mention, x = rice_cat, fill = rice_cat)) +
geom_flat_violin(position = position_nudge(x = .1, y = 0), alpha = .8) +
geom_point(aes(y = first_mention, color = rice_cat), 
           position = position_jitter(width = .15), size = .5, alpha = 0.8) +
geom_boxplot(width = .1, alpha = 0.3) +
scale_y_continuous(breaks = seq(0,1,0.5), 
                     labels = {function(x) paste0(as.character(x*100),"%")})+
guides(fill = "none") +
guides(color = "none") +
ylab("Proportion fire mention focal") + 
xlab("") +
theme_classic() + 
labs(title = "Free description") +
theme(plot.title = element_text(hjust = 0.5, size = 8), 
      plot.subtitle = element_text(hjust = 0.5, size = 6), 
      text = element_text(size=8))

US

FD_raw <- tidy_d %>% 
  filter(task_name == "FD") %>% 
  filter(culture == "US") %>% 
  group_by(subject, region) %>%
  summarise(first_mention = mean(as.numeric(resp))) 

ggplot(data = FD_raw, 
       aes(y = first_mention, x = region, fill = region)) +
geom_flat_violin(position = position_nudge(x = .1, y = 0), alpha = .8) +
geom_point(aes(y = first_mention, color = region), 
           position = position_jitter(width = .15), size = .5, alpha = 0.8) +
geom_boxplot(width = .1, alpha = 0.3) +
scale_y_continuous(breaks = seq(0,1,0.5), 
                     labels = {function(x) paste0(as.character(x*100),"%")})+
guides(fill = "none") +
guides(color = "none") +
ylab("Proportion fire mention focal") + 
xlab("") +
theme_classic() + 
labs(title = "Free description") +
theme(plot.title = element_text(hjust = 0.5, size = 8), 
      plot.subtitle = element_text(hjust = 0.5, size = 6), 
      text = element_text(size=8))

FD_raw <- tidy_d %>% 
  filter(task_name == "FD") %>% 
  filter(culture == "US") %>% 
  group_by(subject, coast) %>%
  summarise(first_mention = mean(as.numeric(resp))) 

ggplot(data = FD_raw, 
       aes(y = first_mention, x = coast, fill = coast)) +
geom_flat_violin(position = position_nudge(x = .1, y = 0), alpha = .8) +
geom_point(aes(y = first_mention, color = coast), 
           position = position_jitter(width = .15), size = .5, alpha = 0.8) +
geom_boxplot(width = .1, alpha = 0.3) +
scale_y_continuous(breaks = seq(0,1,0.5), 
                     labels = {function(x) paste0(as.character(x*100),"%")})+
guides(fill = "none") +
guides(color = "none") +
ylab("Proportion fire mention focal") + 
xlab("") +
theme_classic() + 
labs(title = "Free description") +
theme(plot.title = element_text(hjust = 0.5, size = 8), 
      plot.subtitle = element_text(hjust = 0.5, size = 6), 
      text = element_text(size=8))

Symbolic Self-inflation

SSI_raw <- tidy_d %>% 
  filter(task_name == "SSI") %>% 
  mutate(resp = as.numeric(resp)) 


ggplot(data = SSI_raw %>% filter(resp_type == "task_score_diff"), 
       aes(y = resp, x = culture, fill = culture)) +
geom_flat_violin(position = position_nudge(x = .1, y = 0), alpha = .8) +
geom_point(aes(y = resp, color = culture), 
           position = position_jitter(width = .15), size = .5, alpha = 0.8) +
geom_boxplot(width = .1, alpha = 0.3) +
scale_color_manual(values = c("red", "blue"))+
scale_fill_manual(values = c("red", "blue"))+
guides(fill = "none") +
guides(color = "none") +
ylab("") + 
xlab("") +
theme_classic() + 
labs(title = "Symbolic Self Inflation") +
theme(plot.title = element_text(hjust = 0.5, size = 8), 
      plot.subtitle = element_text(hjust = 0.5, size = 6), 
      text = element_text(size=8)) 

ggplot(data = SSI_raw %>% filter(resp_type == "task_score_ratio"), 
       aes(y = resp, x = culture, fill = culture)) +
geom_flat_violin(position = position_nudge(x = .1, y = 0), alpha = .8) +
geom_point(aes(y = resp, color = culture), 
           position = position_jitter(width = .15), size = .5, alpha = 0.8) +
geom_boxplot(width = .1, alpha = 0.3) +
scale_color_manual(values = c("red", "blue"))+
scale_fill_manual(values = c("red", "blue"))+
guides(fill = "none") +
guides(color = "none") +
ylab("") + 
xlab("") +
theme_classic() + 
labs(title = "Symbolic Self Inflation") +
theme(plot.title = element_text(hjust = 0.5, size = 8), 
      plot.subtitle = element_text(hjust = 0.5, size = 6), 
      text = element_text(size=8))

RMTS

plot proportion relation match

RMTS_raw <- tidy_d %>% 
  filter(task_name == "RMTS") %>% 
  group_by(subject, culture) %>%
  summarise(relational_choice = mean(as.numeric(resp)))

ggplot(data = RMTS_raw, 
       aes(y = relational_choice, x = culture, fill = culture)) +
geom_flat_violin(position = position_nudge(x = .1, y = 0), alpha = .8) +
geom_point(aes(y = relational_choice, color = culture), 
           position = position_jitter(width = .15), size = .5, alpha = 0.8) +
geom_boxplot(width = .1, alpha = 0.3) +
scale_y_continuous(breaks = seq(0,1,0.5), 
                     labels = {function(x) paste0(as.character(x*100),"%")})+
scale_color_manual(values = c("red", "blue"))+
scale_fill_manual(values = c("red", "blue"))+
guides(fill = "none") +
guides(color = "none") +
ylab("Proportion relational choice") + 
xlab("") +
theme_classic() + 
labs(title = "Ambiguous RMTS") +
theme(plot.title = element_text(hjust = 0.5, size = 8), 
      plot.subtitle = element_text(hjust = 0.5, size = 6), 
      text = element_text(size=8))

Ravens

RV_raw <- tidy_d %>% 
  filter(task_name == "RV") %>% 
  group_by(subject, culture) %>%
  summarise(RV_resp = mean(as.numeric(resp)))

ggplot(data = RV_raw, 
       aes(y = RV_resp, x = culture, fill = culture)) +
geom_flat_violin(position = position_nudge(x = .1, y = 0), alpha = .8) +
geom_point(aes(y = RV_resp, color = culture), 
           position = position_jitter(width = .15), size = .5, alpha = 0.8) +
geom_boxplot(width = .1, alpha = 0.3) +
scale_y_continuous(breaks = seq(0,1,0.5), 
                     labels = {function(x) paste0(as.character(x*100),"%")})+
scale_color_manual(values = c("red", "blue"))+
scale_fill_manual(values = c("red", "blue"))+
guides(fill = "none") +
guides(color = "none") +
ylab("Ravens proportion correct") + 
xlab("") +
theme_classic() + 
labs(title = "Ravens") +
theme(plot.title = element_text(hjust = 0.5, size = 8), 
      plot.subtitle = element_text(hjust = 0.5, size = 6), 
      text = element_text(size=8))

within country

CN

RV_raw <- tidy_d %>% 
  filter(task_name == "RV") %>% 
  filter(culture == "CN") %>% 
  group_by(subject, rice_cat) %>%
  summarise(RV_resp = mean(as.numeric(resp))) %>% 
  mutate(rice_cat = ifelse(rice_cat == 1, "wheat", "rice"))

ggplot(data = RV_raw, 
       aes(y = RV_resp, x = rice_cat, fill = rice_cat)) +
geom_flat_violin(position = position_nudge(x = .1, y = 0), alpha = .8) +
geom_point(aes(y = RV_resp, color = rice_cat), 
           position = position_jitter(width = .15), size = .5, alpha = 0.8) +
geom_boxplot(width = .1, alpha = 0.3) +
scale_y_continuous(breaks = seq(0,1,0.5), 
                     labels = {function(x) paste0(as.character(x*100),"%")})+
guides(fill = "none") +
guides(color = "none") +
ylab("Ravens proportion correct") + 
xlab("") +
theme_classic() + 
labs(title = "Ravens") +
theme(plot.title = element_text(hjust = 0.5, size = 8), 
      plot.subtitle = element_text(hjust = 0.5, size = 6), 
      text = element_text(size=8))

tidy_d %>% 
  filter(task_name == "RV") %>% 
  filter(culture == "CN") %>% 
  group_by(subject, percent_paddy) %>% 
  summarise(RV_resp = mean(as.numeric(resp))) %>% 
  ggplot(aes(x = percent_paddy, 
             y = RV_resp)) + 
  geom_point() + 
  geom_smooth()

US

RV_raw <- tidy_d %>% 
  filter(task_name == "RV") %>% 
  filter(culture == "US") %>% 
  group_by(subject, region) %>%
  summarise(RV_resp = mean(as.numeric(resp))) 

ggplot(data = RV_raw, 
       aes(y = RV_resp, x = region, fill = region)) +
geom_flat_violin(position = position_nudge(x = .1, y = 0), alpha = .8) +
geom_point(aes(y = RV_resp, color = region), 
           position = position_jitter(width = .15), size = .5, alpha = 0.8) +
geom_boxplot(width = .1, alpha = 0.3) +
scale_y_continuous(breaks = seq(0,1,0.5), 
                     labels = {function(x) paste0(as.character(x*100),"%")})+
guides(fill = "none") +
guides(color = "none") +
ylab("Ravens proportion correct") + 
xlab("") +
theme_classic() + 
labs(title = "Ravens") +
theme(plot.title = element_text(hjust = 0.5, size = 8), 
      plot.subtitle = element_text(hjust = 0.5, size = 6), 
      text = element_text(size=8))

RV_raw <- tidy_d %>% 
  filter(task_name == "RV") %>% 
  filter(culture == "US") %>% 
  group_by(subject, coast) %>%
  summarise(RV_resp = mean(as.numeric(resp))) 

ggplot(data = RV_raw, 
       aes(y = RV_resp, x = coast, fill = coast)) +
geom_flat_violin(position = position_nudge(x = .1, y = 0), alpha = .8) +
geom_point(aes(y = RV_resp, color = coast), 
           position = position_jitter(width = .15), size = .5, alpha = 0.8) +
geom_boxplot(width = .1, alpha = 0.3) +
scale_y_continuous(breaks = seq(0,1,0.5), 
                     labels = {function(x) paste0(as.character(x*100),"%")})+
guides(fill = "none") +
guides(color = "none") +
ylab("Ravens proportion correct") + 
xlab("") +
theme_classic() + 
labs(title = "Ravens") +
theme(plot.title = element_text(hjust = 0.5, size = 8), 
      plot.subtitle = element_text(hjust = 0.5, size = 6), 
      text = element_text(size=8))

Triads

TD_catch_failed <- tidy_d %>% 
  filter(task_name == "TD") %>% 
  filter(task_info == "catch") %>% 
  filter(resp = FALSE) %>% 
  pull(subject)

TD_raw <- tidy_d %>% 
  filter(!subject %in% TD_catch_failed) %>% 
  filter(task_name == "TD") %>% 
  group_by(subject, culture) %>%
  summarise(tax_match = mean(as.logical(resp)))

ggplot(data = TD_raw, 
       aes(y = tax_match, x = culture, fill = culture)) +
geom_flat_violin(position = position_nudge(x = .1, y = 0), alpha = .8) +
geom_point(aes(y = tax_match, color = culture), 
           position = position_jitter(width = .15), size = .5, alpha = 0.8) +
geom_boxplot(width = .1, alpha = 0.3) +
scale_y_continuous(breaks = seq(0,1,0.5), 
                     labels = {function(x) paste0(as.character(x*100),"%")})+
scale_color_manual(values = c("red", "blue"))+
scale_fill_manual(values = c("red", "blue"))+
guides(fill = "none") +
guides(color = "none") +
ylab("Triads taxonomic match") + 
xlab("") +
theme_classic() + 
labs(title = "Triads") +
theme(plot.title = element_text(hjust = 0.5, size = 8), 
      plot.subtitle = element_text(hjust = 0.5, size = 6), 
      text = element_text(size=8))

within country

CN

TD_catch_failed <- tidy_d %>% 
  filter(task_name == "TD") %>% 
  filter(task_info == "catch") %>% 
  filter(resp = FALSE) %>% 
  pull(subject)

TD_raw <- tidy_d %>% 
  filter(culture == "CN") %>% 
  filter(!subject %in% TD_catch_failed) %>% 
  filter(task_name == "TD") %>% 
  group_by(subject, rice_cat) %>%
  summarise(tax_match = mean(as.logical(resp))) %>% 
  mutate(rice_cat = ifelse(rice_cat == 1, "wheat", "rice"))

ggplot(data = TD_raw, 
       aes(y = tax_match, x = rice_cat, fill = rice_cat)) +
geom_flat_violin(position = position_nudge(x = .1, y = 0), alpha = .8) +
geom_point(aes(y = tax_match, color = rice_cat), 
           position = position_jitter(width = .15), size = .5, alpha = 0.8) +
geom_boxplot(width = .1, alpha = 0.3) +
scale_y_continuous(breaks = seq(0,1,0.5), 
                     labels = {function(x) paste0(as.character(x*100),"%")})+
guides(fill = "none") +
guides(color = "none") +
ylab("Triads proportion tax match") + 
xlab("") +
theme_classic() + 
labs(title = "Triads") +
theme(plot.title = element_text(hjust = 0.5, size = 8), 
      plot.subtitle = element_text(hjust = 0.5, size = 6), 
      text = element_text(size=8))

TD_raw <- tidy_d %>% 
  filter(culture == "CN") %>% 
  filter(!subject %in% TD_catch_failed) %>% 
  filter(task_name == "TD") %>% 
  group_by(subject, percent_paddy) %>%
  summarise(tax_match = mean(as.logical(resp))) 
 
  
TD_raw %>% 
  ggplot(aes(x = percent_paddy, 
             y = tax_match)) + 
  geom_point() + 
  geom_smooth()

US

TD_catch_failed <- tidy_d %>% 
  filter(task_name == "TD") %>% 
  filter(task_info == "catch") %>% 
  filter(resp = FALSE) %>% 
  pull(subject)

TD_raw <- tidy_d %>% 
  filter(culture == "US") %>% 
  filter(!subject %in% TD_catch_failed) %>% 
  filter(task_name == "TD") %>% 
  group_by(subject, region) %>%
  summarise(tax_match = mean(as.logical(resp)))

ggplot(data = TD_raw, 
       aes(y = tax_match, x = region, fill = region)) +
geom_flat_violin(position = position_nudge(x = .1, y = 0), alpha = .8) +
geom_point(aes(y = tax_match), 
           position = position_jitter(width = .15), size = .5, alpha = 0.8) +
geom_boxplot(width = .1, alpha = 0.3) +
scale_y_continuous(breaks = seq(0,1,0.5), 
                     labels = {function(x) paste0(as.character(x*100),"%")})+
guides(fill = "none") +
guides(color = "none") +
ylab("Triads taxonomic match") + 
xlab("") +
theme_classic() + 
labs(title = "Triads") +
theme(plot.title = element_text(hjust = 0.5, size = 8), 
      plot.subtitle = element_text(hjust = 0.5, size = 6), 
      text = element_text(size=8))

TD_raw <- tidy_d %>% 
  filter(culture == "US") %>% 
  filter(!subject %in% TD_catch_failed) %>% 
  filter(task_name == "TD") %>% 
  group_by(subject, coast) %>%
  summarise(tax_match = mean(as.logical(resp)))

ggplot(data = TD_raw, 
       aes(y = tax_match, x = coast, fill = coast)) +
geom_flat_violin(position = position_nudge(x = .1, y = 0), alpha = .8) +
geom_point(aes(y = tax_match), 
           position = position_jitter(width = .15), size = .5, alpha = 0.8) +
geom_boxplot(width = .1, alpha = 0.3) +
scale_y_continuous(breaks = seq(0,1,0.5), 
                     labels = {function(x) paste0(as.character(x*100),"%")})+
guides(fill = "none") +
guides(color = "none") +
ylab("Triads taxonomic match") + 
xlab("") +
theme_classic() + 
labs(title = "Triads") +
theme(plot.title = element_text(hjust = 0.5, size = 8), 
      plot.subtitle = element_text(hjust = 0.5, size = 6), 
      text = element_text(size=8))

Semantic Intuition

SeI_raw <- tidy_d %>% 
  filter(task_name == "SeI") %>% 
  filter(task_info == "critical") %>% 
  mutate(causal_historical_choice = case_when(
    resp == "causal_historical" ~ TRUE,
    resp == "descriptivist" ~ FALSE
  )) %>% 
  group_by(subject, culture) %>%
  summarise(causal_historical_resp = mean(causal_historical_choice))

ggplot(data = SeI_raw, 
       aes(y = causal_historical_resp, x = culture, fill = culture)) +
geom_flat_violin(position = position_nudge(x = .1, y = 0), alpha = .8) +
geom_point(aes(y = causal_historical_resp, color = culture), 
           position = position_jitter(width = .15), size = .5, alpha = 0.8) +
geom_boxplot(width = .1, alpha = 0.3) +
scale_y_continuous(breaks = seq(0,1,0.5), 
                     labels = {function(x) paste0(as.character(x*100),"%")})+
scale_color_manual(values = c("red", "blue"))+
scale_fill_manual(values = c("red", "blue"))+
guides(fill = "none") +
guides(color = "none") +
ylab("Causal Historical Choice") + 
xlab("") +
theme_classic() + 
labs(title = "Semantic Intuition") +
theme(plot.title = element_text(hjust = 0.5, size = 8), 
      plot.subtitle = element_text(hjust = 0.5, size = 6), 
      text = element_text(size=8))

## within country {.tabset}

CN

SeI_raw <- tidy_d %>% 
  filter(task_name == "SeI") %>% 
  filter(culture == "CN") %>% 
  filter(task_info == "critical") %>% 
  mutate(causal_historical_choice = case_when(
    resp == "causal_historical" ~ TRUE,
    resp == "descriptivist" ~ FALSE
  )) %>% 
  group_by(subject, rice_cat) %>%
  summarise(causal_historical_resp = mean(causal_historical_choice)) %>% 
mutate(rice_cat = ifelse(rice_cat == 1, "wheat", "rice"))


ggplot(data = SeI_raw, 
       aes(y = causal_historical_resp, x = rice_cat, fill = rice_cat)) +
geom_flat_violin(position = position_nudge(x = .1, y = 0), alpha = .8) +
geom_point(aes(y = causal_historical_resp, color = rice_cat), 
           position = position_jitter(width = .15), size = .5, alpha = 0.8) +
geom_boxplot(width = .1, alpha = 0.3) +
scale_y_continuous(breaks = seq(0,1,0.5), 
                     labels = {function(x) paste0(as.character(x*100),"%")})+
guides(fill = "none") +
guides(color = "none") +
ylab("Causal Historical Choice") + 
xlab("") +
theme_classic() + 
labs(title = "Semantic Intuition") +
theme(plot.title = element_text(hjust = 0.5, size = 8), 
      plot.subtitle = element_text(hjust = 0.5, size = 6), 
      text = element_text(size=8))

US

SeI_raw <- tidy_d %>% 
  filter(task_name == "SeI") %>% 
  filter(culture == "US") %>% 
  filter(task_info == "critical") %>% 
  mutate(causal_historical_choice = case_when(
    resp == "causal_historical" ~ TRUE,
    resp == "descriptivist" ~ FALSE
  )) %>% 
  group_by(subject, region) %>%
  summarise(causal_historical_resp = mean(causal_historical_choice))


ggplot(data = SeI_raw, 
       aes(y = causal_historical_resp, x = region, fill = region)) +
geom_flat_violin(position = position_nudge(x = .1, y = 0), alpha = .8) +
geom_point(aes(y = causal_historical_resp, color = region), 
           position = position_jitter(width = .15), size = .5, alpha = 0.8) +
geom_boxplot(width = .1, alpha = 0.3) +
scale_y_continuous(breaks = seq(0,1,0.5), 
                     labels = {function(x) paste0(as.character(x*100),"%")})+
guides(fill = "none") +
guides(color = "none") +
ylab("Causal Historical Choice") + 
xlab("") +
theme_classic() + 
labs(title = "Semantic Intuition") +
theme(plot.title = element_text(hjust = 0.5, size = 8), 
      plot.subtitle = element_text(hjust = 0.5, size = 6), 
      text = element_text(size=8))

SeI_raw <- tidy_d %>% 
  filter(task_name == "SeI") %>% 
  filter(culture == "US") %>% 
  filter(task_info == "critical") %>% 
  mutate(causal_historical_choice = case_when(
    resp == "causal_historical" ~ TRUE,
    resp == "descriptivist" ~ FALSE
  )) %>% 
  group_by(subject, coast) %>%
  summarise(causal_historical_resp = mean(causal_historical_choice))


ggplot(data = SeI_raw, 
       aes(y = causal_historical_resp, x = coast, fill = coast)) +
geom_flat_violin(position = position_nudge(x = .1, y = 0), alpha = .8) +
geom_point(aes(y = causal_historical_resp, color = coast), 
           position = position_jitter(width = .15), size = .5, alpha = 0.8) +
geom_boxplot(width = .1, alpha = 0.3) +
scale_y_continuous(breaks = seq(0,1,0.5), 
                     labels = {function(x) paste0(as.character(x*100),"%")})+
guides(fill = "none") +
guides(color = "none") +
ylab("Causal Historical Choice") + 
xlab("") +
theme_classic() + 
labs(title = "Semantic Intuition") +
theme(plot.title = element_text(hjust = 0.5, size = 8), 
      plot.subtitle = element_text(hjust = 0.5, size = 6), 
      text = element_text(size=8))

Change detection

RT

tidy_d %>% 
  filter(task_name == "CD") %>% 
  mutate(acc_raw = case_when( 
    resp == "null" ~ 0, 
    TRUE ~ 1)) %>% 
 ggplot( 
       aes(y = acc_raw, x = culture, fill = culture)) +
geom_flat_violin(position = position_nudge(x = .1, y = 0), alpha = .8) +
geom_point(aes(y = acc_raw, color = culture), 
           position = position_jitter(width = .15), size = .2, alpha = 0.6) +
geom_boxplot(width = .1, alpha = 0.3) +
scale_y_continuous(breaks = seq(0,1,0.5), 
                     labels = {function(x) paste0(as.character(x*100),"%")})+
scale_color_manual(values = c("red", "blue"))+
scale_fill_manual(values = c("red", "blue"))+
guides(fill = "none") +
guides(color = "none") +
ylab("acc_raw") + 
xlab("") +
theme_classic() + 
labs(title = "Change Detection") +
theme(plot.title = element_text(hjust = 0.5, size = 8), 
      plot.subtitle = element_text(hjust = 0.5, size = 6), 
      text = element_text(size=8)) + 
  facet_wrap(~task_info)

raw_CD <- tidy_d %>% 
  filter(task_name == "CD") %>% 
  mutate(log_rt = log(as.numeric(resp))) 
  
ggplot(data = raw_CD, 
       aes(y = log_rt, x = culture, fill = culture)) +
geom_flat_violin(position = position_nudge(x = .1, y = 0), alpha = .8) +
geom_point(aes(y = log_rt, color = culture), 
           position = position_jitter(width = .15), size = .2, alpha = 0.6) +
geom_boxplot(width = .1, alpha = 0.3) +
scale_y_continuous(breaks = seq(0,1,0.5), 
                     labels = {function(x) paste0(as.character(x*100),"%")})+
scale_color_manual(values = c("red", "blue"))+
scale_fill_manual(values = c("red", "blue"))+
guides(fill = "none") +
guides(color = "none") +
ylab("log RT(ms)") + 
xlab("") +
theme_classic() + 
labs(title = "Change Detection") +
theme(plot.title = element_text(hjust = 0.5, size = 8), 
      plot.subtitle = element_text(hjust = 0.5, size = 6), 
      text = element_text(size=8)) + 
  facet_wrap(~task_info)

Causal attribution

raw_CA <- tidy_d %>% 
  filter(task_name == "CA") %>% 
  mutate(resp = as.numeric(resp) + 1)

ggplot(data = raw_CA, 
       aes(y = resp, x = culture, fill = culture)) +
geom_flat_violin(position = position_nudge(x = .1, y = 0), alpha = .8) +
geom_point(aes(y = resp, color = culture), 
           position = position_jitter(width = .15), size = .2, alpha = 0.6) +
geom_boxplot(width = .1, alpha = 0.3) +
scale_color_manual(values = c("red", "blue"))+
scale_fill_manual(values = c("red", "blue"))+
guides(fill = "none") +
guides(color = "none") +
ylab("LS rating (1-7)") + 
xlab("") +
theme_classic() + 
labs(title = "Causal Attribution") +
theme(plot.title = element_text(hjust = 0.5, size = 8), 
      plot.subtitle = element_text(hjust = 0.5, size = 6), 
      text = element_text(size=8)) + 
  facet_wrap(~task_info)

Within country

CN

raw_CA_CN <- tidy_d %>% 
  filter(task_name == "CA") %>% 
  filter(culture == "CN") %>% 
  mutate(resp = as.numeric(resp) + 1) %>% 
  mutate(rice_cat = ifelse(rice_cat == 1, "wheat", "rice"))


ggplot(data = raw_CA_CN, 
       aes(y = resp, x = rice_cat, fill = rice_cat)) +
geom_flat_violin(position = position_nudge(x = .1, y = 0), alpha = .8) +
geom_point(aes(y = resp, color = rice_cat), 
           position = position_jitter(width = .15), size = .2, alpha = 0.6) +
geom_boxplot(width = .1, alpha = 0.3) +
guides(fill = "none") +
guides(color = "none") +
ylab("LS rating (1-7)") + 
xlab("") +
theme_classic() + 
labs(title = "Causal Attribution") +
theme(plot.title = element_text(hjust = 0.5, size = 8), 
      plot.subtitle = element_text(hjust = 0.5, size = 6), 
      text = element_text(size=8)) + 
  facet_wrap(~task_info)

US

ggplot(data = raw_CA %>% filter(culture == "US"), 
       aes(y = resp, x = region, fill = region)) +
geom_flat_violin(position = position_nudge(x = .1, y = 0), alpha = .8) +
geom_point(aes(y = resp, color = region), 
           position = position_jitter(width = .15), size = .2, alpha = 0.6) +
geom_boxplot(width = .1, alpha = 0.3) +
guides(fill = "none") +
guides(color = "none") +
ylab("LS rating (1-7)") + 
xlab("") +
theme_classic() + 
labs(title = "Causal Attribution") +
theme(plot.title = element_text(hjust = 0.5, size = 8), 
      plot.subtitle = element_text(hjust = 0.5, size = 6), 
      text = element_text(size=8)) + 
  facet_wrap(~task_info)

ggplot(data = raw_CA %>% filter(culture == "US"), 
       aes(y = resp, x = coast, fill = coast)) +
geom_flat_violin(position = position_nudge(x = .1, y = 0), alpha = .8) +
geom_point(aes(y = resp, color = coast), 
           position = position_jitter(width = .15), size = .2, alpha = 0.6) +
geom_boxplot(width = .1, alpha = 0.3) +
guides(fill = "none") +
guides(color = "none") +
ylab("LS rating (1-7)") + 
xlab("") +
theme_classic() + 
labs(title = "Causal Attribution") +
theme(plot.title = element_text(hjust = 0.5, size = 8), 
      plot.subtitle = element_text(hjust = 0.5, size = 6), 
      text = element_text(size=8)) + 
  facet_wrap(~task_info)