Loading in packages and reading data

library(tidyverse) 
library(knitr) 

data <- read_csv("uncertain100.csv") #whole dataset

print(data)
## # A tibble: 98 × 191
##      PID Gender   Age Shock `Calibrate 0` `Calibrate 100` `Calibrate 50` A     
##    <dbl>  <dbl> <dbl> <dbl>         <dbl>           <dbl>          <dbl> <chr> 
##  1     1      1    18  0.25            -1              -1          0.526 pink  
##  2     2      1    19  1.5             -1              -1          0.526 orange
##  3     3      2    19  1.5             -1              -1          0.526 orange
##  4     4      2    18  0.75            -1              -1          0.526 pink  
##  5     5      1    18  1.5             -1              -1          0.526 orange
##  6     6      1    22  2               -1              -1          0.526 blue  
##  7     7      2    23  1               -1              -1          0.526 yellow
##  8     8      2    19  2               -1              -1          0.526 blue  
##  9     9      2    19  1.5             -1              -1          0.526 black 
## 10    10      2    18  1.5             -1              -1          0.526 orange
## # ℹ 88 more rows
## # ℹ 183 more variables: B <chr>, C <chr>, D <chr>, E <chr>, TT1 <dbl>,
## #   TT2 <dbl>, TT3 <dbl>, TT4 <dbl>, TT5 <dbl>, TT6 <dbl>, TT7 <dbl>,
## #   TT8 <dbl>, TT9 <dbl>, TT10 <dbl>, TT11 <dbl>, TT12 <dbl>, TT13 <dbl>,
## #   TT14 <dbl>, TT15 <dbl>, TT16 <dbl>, TT17 <dbl>, TT18 <dbl>, TT19 <dbl>,
## #   TT20 <dbl>, TT21 <dbl>, TT22 <dbl>, TT23 <dbl>, TT24 <dbl>, TT25 <dbl>,
## #   TT26 <dbl>, TT27 <dbl>, TT28 <dbl>, TT29 <dbl>, TT30 <dbl>, TT31 <dbl>, …

Coding Awareness, IUS score, and STAI score

coded_data <- data %>%
  mutate(awareness = case_when(Ccont > Bcont & Bcont > Acont & Ccont > 4 & Acont < 2 ~ "aware",
                               TRUE ~ "unaware"),
         IUSscore = rowSums(select(., 160:171)),
         STAITscore = ((3 - STq1) + STq2 + STq3 + STq4 + STq5 + (3 - STq6) + (3 - STq7) + STq8 + STq9 + STq10 + STq11 + STq12 + (3 - STq13) + (3 - STq14) + STq15 + (3 - STq16) + STq17 + STq18 + (3 - STq19) + STq20))

reverse score 1, 6, 7, 10, 13, 14, 16, 19 for STAIT

median splitting

median <- coded_data %>% 
  select(c(193, 194)) %>% 
  summarise(median_IUS = median(IUSscore), median_TA = median(STAITscore))

print(median)
## # A tibble: 1 × 2
##   median_IUS median_TA
##        <dbl>     <dbl>
## 1         36        29
split_data <- coded_data %>% 
  mutate(IUS = case_when(IUSscore > median$median_IUS ~ "high",
                         TRUE ~ "low"),
         TA = case_when(STAITscore > median$median_TA ~ "high",
                        TRUE ~ "low")) %>% 
  select(-c(5:12))

aware_count <- split_data %>% 
  group_by(awareness) %>% 
  summarise(count = n()) %>% 
  ungroup()

print(aware_count)
## # A tibble: 2 × 2
##   awareness count
##   <chr>     <int>
## 1 aware        79
## 2 unaware      19
aware_count_ID <- split_data %>% 
  group_by(awareness, TA, IUS) %>% 
  summarise(count = n()) %>% 
  ungroup

print(aware_count_ID)
## # A tibble: 8 × 4
##   awareness TA    IUS   count
##   <chr>     <chr> <chr> <int>
## 1 aware     high  high     19
## 2 aware     high  low      18
## 3 aware     low   high     12
## 4 aware     low   low      30
## 5 unaware   high  high      6
## 6 unaware   high  low       5
## 7 unaware   low   high      4
## 8 unaware   low   low       4

Uncounterbalancing anxiety and scl data

trial_data <- split_data %>% 
  subset(select= c(1:40, 184, 187:188)) %>% #taking trial type only
  rename_at(vars(5:40), ~as.character(1:36)) %>% #renaming columns to just be trial number
  pivot_longer(cols = 5:40, names_to = "trial", values_to = "type") #pivoting to get trial number and trial type values

print(trial_data)
## # A tibble: 3,528 × 9
##      PID Gender   Age Shock awareness IUS   TA    trial  type
##    <dbl>  <dbl> <dbl> <dbl> <chr>     <chr> <chr> <chr> <dbl>
##  1     1      1    18  0.25 aware     low   low   1         6
##  2     1      1    18  0.25 aware     low   low   2         1
##  3     1      1    18  0.25 aware     low   low   3         2
##  4     1      1    18  0.25 aware     low   low   4         5
##  5     1      1    18  0.25 aware     low   low   5         5
##  6     1      1    18  0.25 aware     low   low   6         6
##  7     1      1    18  0.25 aware     low   low   7         7
##  8     1      1    18  0.25 aware     low   low   8         1
##  9     1      1    18  0.25 aware     low   low   9         2
## 10     1      1    18  0.25 aware     low   low   10        7
## # ℹ 3,518 more rows
anx_data <- split_data %>% 
  subset(select= c(1, 41:76)) %>% #taking anxiety only
  rename_at(vars(2:37), ~as.character(1:36)) %>% #renaming columns to just be trial number
  pivot_longer(cols = 2:37, names_to = "trial", values_to = "anx") #pivoting to get trial number and anxiety values

print(anx_data)
## # A tibble: 3,528 × 3
##      PID trial   anx
##    <dbl> <chr> <dbl>
##  1     1 1       -99
##  2     1 2       -99
##  3     1 3       -99
##  4     1 4       -99
##  5     1 5       -99
##  6     1 6       -99
##  7     1 7       -99
##  8     1 8       -99
##  9     1 9       -99
## 10     1 10       12
## # ℹ 3,518 more rows
baseSCL_data <- split_data %>% 
  subset(select= c(1, 77:112)) %>% #taking anxiety only
  rename_at(vars(2:37), ~as.character(1:36)) %>% #renaming columns to just be trial number
  pivot_longer(cols = 2:37, names_to = "trial", values_to = "base") #pivoting to get trial number and baseline SCL values

csSCL_data <- split_data %>% 
  subset(select= c(1, 113:148)) %>% #taking anxiety only
  rename_at(vars(2:37), ~as.character(1:36)) %>% #renaming columns to just be trial number
  pivot_longer(cols = 2:37, names_to = "trial", values_to = "cs") #pivoting to get trial number and cs SCL values

comb_data <- cbind(trial_data, anx = anx_data$anx, base = baseSCL_data$base, cs = csSCL_data$cs) #combining dataframes into one

comb_data$trial <- as.numeric(comb_data$trial)

head(comb_data)
##   PID Gender Age Shock awareness IUS  TA trial type anx    base      cs
## 1   1      1  18  0.25     aware low low     1    6 -99 -0.4910  2.5879
## 2   1      1  18  0.25     aware low low     2    1 -99  2.3634  1.3574
## 3   1      1  18  0.25     aware low low     3    2 -99 -0.3407 -0.6572
## 4   1      1  18  0.25     aware low low     4    5 -99  2.2691  1.5259
## 5   1      1  18  0.25     aware low low     5    5 -99 -0.6053  0.7061
## 6   1      1  18  0.25     aware low low     6    6 -99  9.0449  7.5666
clean_data <- comb_data %>% 
  mutate(SCLchange = (cs - base)) %>% 
  filter(trial > 10)

SCLadjust <- clean_data %>% 
  filter(trial > 11) %>% 
  group_by(PID) %>% 
  summarise(min = min(SCLchange)) %>% 
  slice(rep(1:n(), each = 26))

Collating data for plotting

plot_data <- clean_data %>% 
  mutate(typev2 = case_when(type == 1 ~ "zero",
                            type == 2 | type == 3 ~ "fifty",
                            type == 4 ~ "hundred",
                            TRUE ~ "amb")) %>% 
  group_by(PID, typev2) %>% 
  mutate(exptrial = row_number()) %>% 
  ungroup() %>% 
  mutate(anx2 = case_when(anx == -99 ~ 50,
                          TRUE ~ anx),
         SCL2 = SCLchange - SCLadjust$min)

plot_data$typev2 <- fct_relevel(plot_data$typev2, c("zero", "fifty", "hundred", "amb"))

Exclusions: - Participant 18 (failed to used anxiety dial)

Plots

Plotting overall acquisition

overall_acq_data <- plot_data %>% 
  filter(trial < 29, PID != 18) %>% 
  group_by(typev2, exptrial) %>% 
  summarise(mean_anx = mean(anx2),
            mean_SCL = mean(log(SCL2 + 1)),
            se_anx = sd(anx2)/sqrt(n()),
            se_SCL = sd(log(SCL2 + 1))/sqrt(n())) %>% 
  ungroup() 

overall_anx_acq_plot <- ggplot(data = overall_acq_data, mapping = aes(x = exptrial, y = mean_anx, col = typev2)) +
  geom_line() +
  geom_point() +
  geom_errorbar(mapping = aes(min = mean_anx - se_anx, max = mean_anx + se_anx), width = 0.1) +
  scale_color_manual(values = c("zero" = "#ff0000", "fifty" = "#0dca41", "hundred" = "#002fff"),
                     labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred")) +
  labs(x = "Trial",
       y = "Anxiety") +
  scale_x_continuous(breaks = c(1, 2, 3, 4, 5, 6)) +
  theme_minimal() +
  theme(axis.line.y = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.y = element_line(colour = "black", size = 0.5),
        axis.line.x.bottom = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.x.bottom = element_line(colour = "black", size = 0.5),
        axis.ticks.length = unit(-0.1, "cm"),
        axis.line.x = element_line(colour = "black", linewidth = 0.5),
        panel.grid = element_blank(),
        legend.title = element_blank(),
        legend.key = element_blank())

print(overall_anx_acq_plot)

overall_SCL_acq_plot <- ggplot(data = overall_acq_data, mapping = aes(x = exptrial, y = mean_SCL, col = typev2)) +
  geom_line() +
  geom_point() +
  geom_errorbar(mapping = aes(min = mean_SCL - se_SCL, max = mean_SCL + se_SCL), width = 0.1) +
  scale_color_manual(values = c("zero" = "#ff0000", "fifty" = "#0dca41", "hundred" = "#002fff"),
                     labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred")) +
  labs(x = "Trial",
       y = "SCL") +
  scale_x_continuous(breaks = c(1, 2, 3, 4, 5, 6)) +
  theme_minimal() +
  theme(axis.line.y = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.y = element_line(colour = "black", size = 0.5),
        axis.line.x.bottom = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.x.bottom = element_line(colour = "black", size = 0.5),
        axis.ticks.length = unit(-0.1, "cm"),
        axis.line.x = element_line(colour = "black", linewidth = 0.5),
        panel.grid = element_blank(),
        legend.title = element_blank(),
        legend.key = element_blank())


print(overall_SCL_acq_plot)

overall test anxiety

overall_anx_test_data <- plot_data %>% 
  filter(trial > 26 & trial < 33, PID != 18) %>% 
  group_by(typev2) %>% 
  summarise(mean_anx = mean(anx2),
            mean_SCL = mean(log(SCL2 + 1)),
            se_anx = sd(anx2)/sqrt(n()),
            se_SCL = sd(log(SCL2 + 1))/sqrt(n())) %>% 
  ungroup()


overall_anx_test_plot <- ggplot(data = overall_anx_test_data, mapping = aes(x = typev2, y = mean_anx, fill = typev2)) +
  geom_col() +
  geom_errorbar(mapping = aes(min = mean_anx - se_anx, max = mean_anx + se_anx), width = 0) +
  scale_fill_manual(values = c("zero" = "#ff0000", "fifty" = "#0dca41", "hundred" = "#002fff", "amb" = "#7b21d1"),
                     labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred", "amb" = "Ambiguous")) +
  scale_x_discrete(labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred", "amb" = "Ambiguous")) + 
  coord_cartesian(ylim = c(0, 60)) +
  scale_y_continuous(breaks = c(0, 20, 40, 60)) +
  labs(x = "CS",
       y = "Anxiety") +
  theme_minimal() +
  theme(axis.line.y = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.y = element_line(colour = "black", size = 0.5),
        axis.line.x.bottom = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.length = unit(-0.1, "cm"),
        axis.line.x = element_line(colour = "black", linewidth = 0.5),
        panel.grid = element_blank(),
        legend.title = element_blank(),
        legend.key = element_blank())


print(overall_anx_test_plot)

Overall Expectancy

overall_exp_test_data <- plot_data %>% 
  filter(trial > 32, PID != 18) %>% 
  group_by(typev2) %>% 
  summarise(mean_anx = mean(anx2),
            mean_SCL = mean(log(SCL2 + 1)),
            se_anx = sd(anx2)/sqrt(n()),
            se_SCL = sd(log(SCL2 + 1))/sqrt(n())) %>% 
  ungroup()


overall_exp_test_plot <- ggplot(data = overall_exp_test_data, mapping = aes(x = typev2, y = mean_anx, fill = typev2)) +
  geom_col() +
  geom_errorbar(mapping = aes(min = mean_anx - se_anx, max = mean_anx + se_anx), width = 0) +
  scale_fill_manual(values = c("zero" = "#ff0000", "fifty" = "#0dca41", "hundred" = "#002fff", "amb" = "#7b21d1"),
                     labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred", "amb" = "Ambiguous")) +
  scale_x_discrete(labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred", "amb" = "Ambiguous")) + 
  labs(x = "CS",
       y = "Expectancy") +
  theme_minimal() +
  theme(axis.line.y = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.y = element_line(colour = "black", size = 0.5),
        axis.line.x.bottom = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.length = unit(-0.1, "cm"),
        axis.line.x = element_line(colour = "black", linewidth = 0.5),
        panel.grid = element_blank(),
        legend.title = element_blank(),
        legend.key = element_blank())

print(overall_exp_test_plot)

Overall test SCL

overall_SCL_test_data <- plot_data %>% 
  filter(trial > 26, PID != 18) %>% 
  group_by(typev2) %>% 
  summarise(mean_anx = mean(anx2),
            mean_SCL = mean(log(SCL2 + 1)),
            se_anx = sd(anx2)/sqrt(n()),
            se_SCL = sd(log(SCL2 + 1))/sqrt(n())) %>% 
  ungroup()

overall_SCL_test_plot <- ggplot(data = overall_SCL_test_data, mapping = aes(x = typev2, y = mean_SCL, fill = typev2)) +
  geom_col() +
  geom_errorbar(mapping = aes(min = mean_SCL - se_SCL, max = mean_SCL + se_SCL), width = 0) +
  scale_fill_manual(values = c("zero" = "#ff0000", "fifty" = "#0dca41", "hundred" = "#002fff", "amb" = "#7b21d1"),
                     labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred", "amb" = "Ambiguous")) +
  scale_x_discrete(labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred", "amb" = "Ambiguous")) + 
  labs(x = "CS",
       y = "SCL") +
  theme_minimal() +
  theme(axis.line.y = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.y = element_line(colour = "black", size = 0.5),
        axis.line.x.bottom = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.length = unit(-0.1, "cm"),
        axis.line.x = element_line(colour = "black", linewidth = 0.5),
        panel.grid = element_blank(),
        legend.title = element_blank(),
        legend.key = element_blank())

print(overall_SCL_test_plot)

aware acquisition

aware_acq_data <- plot_data %>% 
  filter(trial < 29, PID != 18) %>% 
  group_by(typev2, exptrial, awareness) %>% 
  summarise(mean_anx = mean(anx2),
            mean_SCL = mean(log(SCL2 + 1)),
            se_anx = sd(anx2)/sqrt(n()),
            se_SCL = sd(log(SCL2 + 1))/sqrt(n())) %>% 
  ungroup()

aware_anx_acq_plot <- ggplot(data = aware_acq_data, mapping = aes(x = exptrial, y = mean_anx, col = typev2)) +
  geom_line(mapping = aes(linetype = awareness)) +
  geom_point(mapping = aes(shape = awareness)) +
  geom_errorbar(mapping = aes(min = mean_anx - se_anx, max = mean_anx + se_anx), width = 0.1) +
  scale_color_manual(values = c("zero" = "#ff0000", "fifty" = "#0dca41", "hundred" = "#002fff"),
                     labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred")) +
  scale_linetype_discrete(labels = c("aware" = "Aware", "unaware" = "Unaware")) +
  scale_shape_discrete(labels = c("aware" = "Aware", "unaware" = "Unaware")) +
  labs(x = "Trial",
       y = "Anxiety") +
  scale_x_continuous(breaks = c(1, 2, 3, 4, 5, 6)) +
  theme_minimal() +
  theme(axis.line.y = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.y = element_line(colour = "black", size = 0.5),
        axis.line.x.bottom = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.x.bottom = element_line(colour = "black", size = 0.5),
        axis.ticks.length = unit(-0.1, "cm"),
        axis.line.x = element_line(colour = "black", linewidth = 0.5),
        panel.grid = element_blank(),
        legend.title = element_blank(),
        legend.key = element_blank())

print(aware_anx_acq_plot)

aware_SCL_acq_plot <- ggplot(data = aware_acq_data, mapping = aes(x = exptrial, y = mean_SCL, col = typev2)) +
  geom_line(mapping = aes(linetype = awareness)) +
  geom_point(mapping = aes(shape = awareness)) +
  geom_errorbar(mapping = aes(min = mean_SCL - se_SCL, max = mean_SCL + se_SCL), width = 0.1) +
  scale_color_manual(values = c("zero" = "#ff0000", "fifty" = "#0dca41", "hundred" = "#002fff"),
                     labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred")) +
  scale_linetype_discrete(labels = c("aware" = "Aware", "unaware" = "Unaware")) +
  scale_shape_discrete(labels = c("aware" = "Aware", "unaware" = "Unaware")) +
  labs(x = "Trial",
       y = "Anxiety") +
  scale_x_continuous(breaks = c(1, 2, 3, 4, 5, 6)) +
  theme_minimal() +
  theme(axis.line.y = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.y = element_line(colour = "black", size = 0.5),
        axis.line.x.bottom = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.x.bottom = element_line(colour = "black", size = 0.5),
        axis.ticks.length = unit(-0.1, "cm"),
        axis.line.x = element_line(colour = "black", linewidth = 0.5),
        panel.grid = element_blank(),
        legend.title = element_blank(),
        legend.key = element_blank())

print(aware_SCL_acq_plot)

aware test anxiety

aware_anx_test_data <- plot_data %>% 
  filter(trial > 26 & trial < 33, PID != 18) %>% 
  group_by(typev2, awareness) %>% 
  summarise(mean_anx = mean(anx2),
            mean_SCL = mean(log(SCL2 + 1)),
            se_anx = sd(anx2)/sqrt(n()),
            se_SCL = sd(log(SCL2 + 1))/sqrt(n())) %>% 
  ungroup()


aware_anx_test_plot <- ggplot(data = aware_anx_test_data, mapping = aes(x = typev2, y = mean_anx, fill = typev2)) +
  facet_wrap(~awareness) +
  geom_col() +
  geom_errorbar(mapping = aes(min = mean_anx - se_anx, max = mean_anx + se_anx), width = 0) +
  scale_fill_manual(values = c("zero" = "#ff0000", "fifty" = "#0dca41", "hundred" = "#002fff", "amb" = "#7b21d1"),
                     labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred", "amb" = "Ambiguous")) +
  scale_x_discrete(labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred", "amb" = "Ambiguous")) + 
  labs(x = "CS",
       y = "Anxiety") +
  theme_minimal() +
  theme(axis.line.y = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.y = element_line(colour = "black", size = 0.5),
        axis.line.x.bottom = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.length = unit(-0.1, "cm"),
        axis.line.x = element_line(colour = "black", linewidth = 0.5),
        panel.grid = element_blank(),
        legend.title = element_blank(),
        legend.key = element_blank())

print(aware_anx_test_plot)

aware expectancy

aware_exp_test_data <- plot_data %>% 
  filter(trial > 32, PID != 18) %>% 
  group_by(typev2, awareness) %>% 
  summarise(mean_anx = mean(anx2),
            mean_SCL = mean(log(SCL2 + 1)),
            se_anx = sd(anx2)/sqrt(n()),
            se_SCL = sd(log(SCL2 + 1))/sqrt(n())) %>% 
  ungroup()


aware_exp_test_plot <- ggplot(data = aware_exp_test_data, mapping = aes(x = typev2, y = mean_anx, fill = typev2)) +
  facet_wrap(~awareness) +
  geom_col() +
  geom_errorbar(mapping = aes(min = mean_anx - se_anx, max = mean_anx + se_anx), width = 0) +
  scale_fill_manual(values = c("zero" = "#ff0000", "fifty" = "#0dca41", "hundred" = "#002fff", "amb" = "#7b21d1"),
                     labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred", "amb" = "Ambiguous")) +
  scale_x_discrete(labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred", "amb" = "Ambiguous")) + 
  labs(x = "CS",
       y = "Expectancy") +
  theme_minimal() +
  theme(axis.line.y = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.y = element_line(colour = "black", size = 0.5),
        axis.line.x.bottom = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.length = unit(-0.1, "cm"),
        axis.line.x = element_line(colour = "black", linewidth = 0.5),
        panel.grid = element_blank(),
        legend.title = element_blank(),
        legend.key = element_blank())

print(aware_exp_test_plot)

aware test SCL

aware_SCL_test_data <- plot_data %>% 
  filter(trial > 26, PID != 18) %>% 
  group_by(typev2, awareness) %>% 
  summarise(mean_anx = mean(anx2),
            mean_SCL = mean(log(SCL2 + 1)),
            se_anx = sd(anx2)/sqrt(n()),
            se_SCL = sd(log(SCL2 + 1))/sqrt(n())) %>% 
  ungroup()

aware_SCL_test_plot <- ggplot(data = aware_SCL_test_data, mapping = aes(x = typev2, y = mean_SCL, fill = typev2)) +
  facet_wrap(~awareness) +
  geom_col() +
  geom_errorbar(mapping = aes(min = mean_SCL - se_SCL, max = mean_SCL + se_SCL), width = 0) +
  scale_fill_manual(values = c("zero" = "#ff0000", "fifty" = "#0dca41", "hundred" = "#002fff", "amb" = "#7b21d1"),
                     labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred", "amb" = "Ambiguous")) +
  scale_x_discrete(labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred", "amb" = "Ambiguous")) + 
  labs(x = "CS",
       y = "SCL") +
  theme_minimal() +
  theme(axis.line.y = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.y = element_line(colour = "black", size = 0.5),
        axis.line.x.bottom = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.length = unit(-0.1, "cm"),
        axis.line.x = element_line(colour = "black", linewidth = 0.5),
        panel.grid = element_blank(),
        legend.title = element_blank(),
        legend.key = element_blank())

print(aware_SCL_test_plot)

Trait Anxiety Acquisition

TA_acq_data <- plot_data %>% 
  filter(trial < 29, PID != 18) %>% 
  group_by(typev2, exptrial, TA) %>% 
  summarise(mean_anx = mean(anx2),
            mean_SCL = mean(log(SCL2 + 1)),
            se_anx = sd(anx2)/sqrt(n()),
            se_SCL = sd(log(SCL2 + 1))/sqrt(n())) %>% 
  ungroup()

TA_anx_acq_plot <- ggplot(data = TA_acq_data, mapping = aes(x = exptrial, y = mean_anx, col = typev2)) +
  geom_line(mapping = aes(linetype = TA)) +
  geom_point(mapping = aes(shape = TA)) +
  geom_errorbar(mapping = aes(min = mean_anx - se_anx, max = mean_anx + se_anx), width = 0.1) +
  scale_color_manual(values = c("zero" = "#ff0000", "fifty" = "#0dca41", "hundred" = "#002fff"),
                     labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred")) +
  scale_linetype_discrete(labels = c("high" = "High Anxious", "low" = "Low Anxious")) +
  scale_shape_discrete(labels = c("high" = "High Anxious", "low" = "Low Anxious")) +
  labs(x = "Trial",
       y = "Anxiety") +
  scale_x_continuous(breaks = c(1, 2, 3, 4, 5, 6)) +
  theme_minimal() +
  theme(axis.line.y = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.y = element_line(colour = "black", size = 0.5),
        axis.line.x.bottom = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.x.bottom = element_line(colour = "black", size = 0.5),
        axis.ticks.length = unit(-0.1, "cm"),
        axis.line.x = element_line(colour = "black", linewidth = 0.5),
        panel.grid = element_blank(),
        legend.title = element_blank(),
        legend.key = element_blank())

print(TA_anx_acq_plot)

TA_SCL_acq_plot <- ggplot(data = TA_acq_data, mapping = aes(x = exptrial, y = mean_SCL, col = typev2)) +
  geom_line(mapping = aes(linetype = TA)) +
  geom_point(mapping = aes(shape = TA)) +
  geom_errorbar(mapping = aes(min = mean_SCL - se_SCL, max = mean_SCL + se_SCL), width = 0.1) + 
  scale_color_manual(values = c("zero" = "#ff0000", "fifty" = "#0dca41", "hundred" = "#002fff"),
                     labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred")) +
  scale_linetype_discrete(labels = c("high" = "High Anxious", "low" = "Low Anxious")) +
  scale_shape_discrete(labels = c("high" = "High Anxious", ";ow" = "Low Anxious")) +
  labs(x = "Trial",
       y = "SCL") +
  scale_x_continuous(breaks = c(1, 2, 3, 4, 5, 6)) +
  theme_minimal() +
  theme(axis.line.y = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.y = element_line(colour = "black", size = 0.5),
        axis.line.x.bottom = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.x.bottom = element_line(colour = "black", size = 0.5),
        axis.ticks.length = unit(-0.1, "cm"),
        axis.line.x = element_line(colour = "black", linewidth = 0.5),
        panel.grid = element_blank(),
        legend.title = element_blank(),
        legend.key = element_blank())

print(TA_SCL_acq_plot)

TA test anxiety

TA_anx_test_data <- plot_data %>% 
  filter(trial > 26 & trial < 33, PID != 18) %>% 
  group_by(typev2, TA) %>% 
  summarise(mean_anx = mean(anx2),
            mean_SCL = mean(log(SCL2 + 1)),
            se_anx = sd(anx2)/sqrt(n()),
            se_SCL = sd(log(SCL2 + 1))/sqrt(n())) %>% 
  ungroup()


TA_anx_test_plot <- ggplot(data = TA_anx_test_data, mapping = aes(x = typev2, y = mean_anx, fill = typev2, linetype = TA)) +
  geom_col(position = "dodge", colour = "black") +
  geom_errorbar(mapping = aes(min = mean_anx - se_anx, max = mean_anx + se_anx), width = 0, position = position_dodge(.9)) +
  scale_fill_manual(values = c("zero" = "#ff0000", "fifty" = "#0dca41", "hundred" = "#002fff", "amb" = "#7b21d1"),
                     labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred", "amb" = "Ambiguous")) +
  scale_linetype_discrete(labels = c("high" = "High Anxious", "low" = "Low Anxious")) +
  scale_x_discrete(labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred", "amb" = "Ambiguous")) + 
  labs(x = "CS",
       y = "Anxiety") +
  theme_minimal() +
  theme(axis.line.y = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.y = element_line(colour = "black", size = 0.5),
        axis.line.x.bottom = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.length = unit(-0.1, "cm"),
        axis.line.x = element_line(colour = "black", linewidth = 0.5),
        panel.grid = element_blank(),
        legend.title = element_blank(),
        legend.key = element_blank())

print(TA_anx_test_plot)

TA expectancy

TA_exp_test_data <- plot_data %>% 
  filter(trial > 32, PID != 18) %>% 
  group_by(typev2, TA) %>% 
  summarise(mean_anx = mean(anx2),
            mean_SCL = mean(log(SCL2 + 1)),
            se_anx = sd(anx2)/sqrt(n()),
            se_SCL = sd(log(SCL2 + 1))/sqrt(n())) %>% 
  ungroup()


TA_exp_test_plot <- ggplot(data = TA_exp_test_data, mapping = aes(x = typev2, y = mean_anx, fill = typev2, linetype = TA)) +
  geom_col(position = "dodge", colour = "black") +
  geom_errorbar(mapping = aes(min = mean_anx - se_anx, max = mean_anx + se_anx), width = 0, position = position_dodge(.9)) +
  scale_fill_manual(values = c("zero" = "#ff0000", "fifty" = "#0dca41", "hundred" = "#002fff", "amb" = "#7b21d1"),
                     labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred", "amb" = "Ambiguous")) +
  scale_linetype_discrete(labels = c("high" = "High Anxious", "low" = "Low Anxious")) +
  scale_x_discrete(labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred", "amb" = "Ambiguous")) + 
  labs(x = "CS",
       y = "Expectancy") +
  theme_minimal() +
  theme(axis.line.y = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.y = element_line(colour = "black", size = 0.5),
        axis.line.x.bottom = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.length = unit(-0.1, "cm"),
        axis.line.x = element_line(colour = "black", linewidth = 0.5),
        panel.grid = element_blank(),
        legend.title = element_blank(),
        legend.key = element_blank())

print(TA_exp_test_plot)

TA SCL

TA_SCL_test_data <- plot_data %>% 
  filter(trial > 26, PID != 18) %>% 
  group_by(typev2, TA) %>% 
  summarise(mean_anx = mean(anx2),
            mean_SCL = mean(log(SCL2 + 1)),
            se_anx = sd(anx2)/sqrt(n()),
            se_SCL = sd(log(SCL2 + 1))/sqrt(n())) %>% 
  ungroup()


TA_SCL_test_plot <- ggplot(data = TA_SCL_test_data, mapping = aes(x = typev2, y = mean_SCL, fill = typev2, linetype = TA)) +
  geom_col(position = "dodge", colour = "black") +
  geom_errorbar(mapping = aes(min = mean_SCL - se_SCL, max = mean_SCL + se_SCL), width = 0, position = position_dodge(.9)) +
  scale_fill_manual(values = c("zero" = "#ff0000", "fifty" = "#0dca41", "hundred" = "#002fff", "amb" = "#7b21d1"),
                     labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred", "amb" = "Ambiguous")) +
  scale_linetype_discrete(labels = c("high" = "High Anxious", "low" = "Low Anxious")) +
  scale_x_discrete(labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred", "amb" = "Ambiguous")) + 
  labs(x = "CS",
       y = "SCL") +
  theme_minimal() +
  theme(axis.line.y = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.y = element_line(colour = "black", size = 0.5),
        axis.line.x.bottom = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.length = unit(-0.1, "cm"),
        axis.line.x = element_line(colour = "black", linewidth = 0.5),
        panel.grid = element_blank(),
        legend.title = element_blank(),
        legend.key = element_blank())

print(TA_SCL_test_plot)

IUS acquisition

IUS_acq_data <- plot_data %>% 
  filter(trial < 29, PID != 18) %>% 
  group_by(typev2, exptrial, IUS) %>% 
  summarise(mean_anx = mean(anx2),
            mean_SCL = mean(log(SCL2 + 1)),
            se_anx = sd(anx2)/sqrt(n()),
            se_SCL = sd(log(SCL2 + 1))/sqrt(n())) %>% 
  ungroup()
IUS_anx_acq_plot <- ggplot(data = IUS_acq_data, mapping = aes(x = exptrial, y = mean_anx, col = typev2)) +
  geom_line(mapping = aes(linetype = IUS)) +
  geom_point(mapping = aes(shape = IUS)) +
  geom_errorbar(mapping = aes(min = mean_anx - se_anx, max = mean_anx + se_anx), width = 0.1) +
  scale_color_manual(values = c("zero" = "#ff0000", "fifty" = "#0dca41", "hundred" = "#002fff"),
                     labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred")) +
  scale_linetype_discrete(labels = c("high" = "High IU", "low" = "Low IU")) +
  scale_shape_discrete(labels = c("high" = "High IU", "low" = "Low IU")) +
  labs(x = "Trial",
       y = "Anxiety") +
  scale_x_continuous(breaks = c(1, 2, 3, 4, 5, 6)) +
  theme_minimal() +
  theme(axis.line.y = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.y = element_line(colour = "black", size = 0.5),
        axis.line.x.bottom = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.x.bottom = element_line(colour = "black", size = 0.5),
        axis.ticks.length = unit(-0.1, "cm"),
        axis.line.x = element_line(colour = "black", linewidth = 0.5),
        panel.grid = element_blank(),
        legend.title = element_blank(),
        legend.key = element_blank())

print(IUS_anx_acq_plot)

IUS_SCL_acq_plot <- ggplot(data = IUS_acq_data, mapping = aes(x = exptrial, y = mean_SCL, col = typev2)) +
  geom_line(mapping = aes(linetype = IUS)) +
  geom_point(mapping = aes(shape = IUS)) +
  geom_errorbar(mapping = aes(min = mean_SCL - se_SCL, max = mean_SCL + se_SCL), width = 0.1) + 
  scale_color_manual(values = c("zero" = "#ff0000", "fifty" = "#0dca41", "hundred" = "#002fff"),
                     labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred")) +
  scale_linetype_discrete(labels = c("high" = "High IU", "low" = "Low IU")) +
  scale_shape_discrete(labels = c("high" = "High IU", "low" = "Low IU")) +
  labs(x = "Trial",
       y = "SCL") +
  scale_x_continuous(breaks = c(1, 2, 3, 4, 5, 6)) +
  theme_minimal() +
  theme(axis.line.y = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.y = element_line(colour = "black", size = 0.5),
        axis.line.x.bottom = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.x.bottom = element_line(colour = "black", size = 0.5),
        axis.ticks.length = unit(-0.1, "cm"),
        axis.line.x = element_line(colour = "black", linewidth = 0.5),
        panel.grid = element_blank(),
        legend.title = element_blank(),
        legend.key = element_blank())

print(IUS_SCL_acq_plot)

IUS test anxiety

IUS_anx_test_data <- plot_data %>% 
  filter(trial > 26 & trial < 33, PID != 18) %>% 
  group_by(typev2, IUS) %>% 
  summarise(mean_anx = mean(anx2),
            mean_SCL = mean(log(SCL2 + 1)),
            se_anx = sd(anx2)/sqrt(n()),
            se_SCL = sd(log(SCL2 + 1))/sqrt(n())) %>% 
  ungroup()


IUS_anx_test_plot <- ggplot(data = IUS_anx_test_data, mapping = aes(x = typev2, y = mean_anx, fill = typev2, linetype = IUS)) +
  geom_col(position = "dodge", colour = "black") +
  geom_errorbar(mapping = aes(min = mean_anx - se_anx, max = mean_anx + se_anx), width = 0, position = position_dodge(.9)) +
  scale_fill_manual(values = c("zero" = "#ff0000", "fifty" = "#0dca41", "hundred" = "#002fff", "amb" = "#7b21d1"),
                     labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred", "amb" = "Ambiguous")) +
  scale_linetype_discrete(labels = c("high" = "High IU", "low" = "Low IU")) +
  scale_x_discrete(labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred", "amb" = "Ambiguous")) + 
  labs(x = "CS",
       y = "Anxiety") +
  theme_minimal() +
  theme(axis.line.y = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.y = element_line(colour = "black", size = 0.5),
        axis.line.x.bottom = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.length = unit(-0.1, "cm"),
        axis.line.x = element_line(colour = "black", linewidth = 0.5),
        panel.grid = element_blank(),
        legend.title = element_blank(),
        legend.key = element_blank())

print(IUS_anx_test_plot)

TA expectancy

IUS_exp_test_data <- plot_data %>% 
  filter(trial > 32, PID != 18) %>% 
  group_by(typev2, IUS) %>% 
  summarise(mean_anx = mean(anx2),
            mean_SCL = mean(log(SCL2 + 1)),
            se_anx = sd(anx2)/sqrt(n()),
            se_SCL = sd(log(SCL2 + 1))/sqrt(n())) %>% 
  ungroup()


IUS_exp_test_plot <- ggplot(data = IUS_exp_test_data, mapping = aes(x = typev2, y = mean_anx, fill = typev2, linetype = IUS)) +
  geom_col(position = "dodge", colour = "black") +
  geom_errorbar(mapping = aes(min = mean_anx - se_anx, max = mean_anx + se_anx), width = 0, position = position_dodge(.9)) +
  scale_fill_manual(values = c("zero" = "#ff0000", "fifty" = "#0dca41", "hundred" = "#002fff", "amb" = "#7b21d1"),
                     labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred", "amb" = "Ambiguous")) +
  scale_linetype_discrete(labels = c("high" = "High IU", "low" = "Low IU")) +
  scale_x_discrete(labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred", "amb" = "Ambiguous")) + 
  labs(x = "CS",
       y = "Expectancy") +
  theme_minimal() +
  theme(axis.line.y = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.y = element_line(colour = "black", size = 0.5),
        axis.line.x.bottom = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.length = unit(-0.1, "cm"),
        axis.line.x = element_line(colour = "black", linewidth = 0.5),
        panel.grid = element_blank(),
        legend.title = element_blank(),
        legend.key = element_blank())


print(IUS_exp_test_plot)

IUS SCL

IUS_SCL_test_data <- plot_data %>% 
  filter(trial > 26, PID != 18) %>% 
  group_by(typev2, IUS) %>% 
  summarise(mean_anx = mean(anx2),
            mean_SCL = mean(log(SCL2 + 1)),
            se_anx = sd(anx2)/sqrt(n()),
            se_SCL = sd(log(SCL2 + 1))/sqrt(n())) %>% 
  ungroup()


IUS_SCL_test_plot <- ggplot(data = IUS_SCL_test_data, mapping = aes(x = typev2, y = mean_SCL, fill = typev2, linetype = IUS)) +
  geom_col(position = "dodge", colour = "black") +
  geom_errorbar(mapping = aes(min = mean_SCL - se_SCL, max = mean_SCL + se_SCL), width = 0, position = position_dodge(.9)) +
  scale_fill_manual(values = c("zero" = "#ff0000", "fifty" = "#0dca41", "hundred" = "#002fff", "amb" = "#7b21d1"),
                     labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred", "amb" = "Ambiguous")) +
  scale_linetype_discrete(labels = c("high" = "High IU", "low" = "Low IU")) +
  scale_x_discrete(labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred", "amb" = "Ambiguous")) + 
  labs(x = "CS",
       y = "SCL") +
  theme_minimal() +
  theme(axis.line.y = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.y = element_line(colour = "black", size = 0.5),
        axis.line.x.bottom = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.length = unit(-0.1, "cm"),
        axis.line.x = element_line(colour = "black", linewidth = 0.5),
        panel.grid = element_blank(),
        legend.title = element_blank(),
        legend.key = element_blank())
print(IUS_SCL_test_plot)

Aware Trait Anxiety Acquisition

TA_acq_data <- plot_data %>% 
  filter(trial < 29, PID != 18) %>% 
  group_by(typev2, exptrial, TA, awareness) %>% 
  summarise(mean_anx = mean(anx2),
            mean_SCL = mean(log(SCL2 + 1)),
            se_anx = sd(anx2)/sqrt(n()),
            se_SCL = sd(log(SCL2 + 1))/sqrt(n())) %>% 
  ungroup()

TA_anx_acq_plot <- ggplot(data = TA_acq_data, mapping = aes(x = exptrial, y = mean_anx, col = typev2)) +
  facet_wrap(~awareness) +
  geom_line(mapping = aes(linetype = TA)) +
  geom_point(mapping = aes(shape = TA)) +
  geom_errorbar(mapping = aes(min = mean_anx - se_anx, max = mean_anx + se_anx), width = 0.1) +
  scale_color_manual(values = c("zero" = "#ff0000", "fifty" = "#0dca41", "hundred" = "#002fff"),
                     labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred")) +
  scale_linetype_discrete(labels = c("high" = "High Anxious", "low" = "Low Anxious")) +
  scale_shape_discrete(labels = c("high" = "High Anxious", "low" = "Low Anxious")) +
  labs(x = "Trial",
       y = "Anxiety") +
  scale_x_continuous(breaks = c(1, 2, 3, 4, 5, 6)) +
  theme_minimal() +
  theme(axis.line.y = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.y = element_line(colour = "black", size = 0.5),
        axis.line.x.bottom = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.x.bottom = element_line(colour = "black", size = 0.5),
        axis.ticks.length = unit(-0.1, "cm"),
        axis.line.x = element_line(colour = "black", linewidth = 0.5),
        panel.grid = element_blank(),
        legend.title = element_blank(),
        legend.key = element_blank())

print(TA_anx_acq_plot)

TA_SCL_acq_plot <- ggplot(data = TA_acq_data, mapping = aes(x = exptrial, y = mean_SCL, col = typev2)) +
  facet_wrap(~awareness) +
  geom_line(mapping = aes(linetype = TA)) +
  geom_point(mapping = aes(shape = TA)) +
  geom_errorbar(mapping = aes(min = mean_SCL - se_SCL, max = mean_SCL + se_SCL), width = 0.1) +
  scale_color_manual(values = c("zero" = "#ff0000", "fifty" = "#0dca41", "hundred" = "#002fff"),
                     labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred")) +
  scale_linetype_discrete(labels = c("high" = "High Anxious", "low" = "Low Anxious")) +
  scale_shape_discrete(labels = c("high" = "High Anxious", "low" = "Low Anxious")) +
  labs(x = "Trial",
       y = "SCL") +
  scale_x_continuous(breaks = c(1, 2, 3, 4, 5, 6)) +
  theme_minimal() +
  theme(axis.line.y = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.y = element_line(colour = "black", size = 0.5),
        axis.line.x.bottom = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.x.bottom = element_line(colour = "black", size = 0.5),
        axis.ticks.length = unit(-0.1, "cm"),
        axis.line.x = element_line(colour = "black", linewidth = 0.5),
        panel.grid = element_blank(),
        legend.title = element_blank(),
        legend.key = element_blank())

print(TA_SCL_acq_plot)

Aware TA test anxiety

TA_anx_test_data <- plot_data %>% 
  filter(trial > 26 & trial < 33, PID != 18) %>% 
  group_by(typev2, TA, awareness) %>% 
  summarise(mean_anx = mean(anx2),
            mean_SCL = mean(log(SCL2 + 1)),
            se_anx = sd(anx2)/sqrt(n()),
            se_SCL = sd(log(SCL2 + 1))/sqrt(n())) %>% 
  ungroup()


TA_anx_test_plot <- ggplot(data = TA_anx_test_data, mapping = aes(x = typev2, y = mean_anx, fill = typev2, linetype = TA)) +
  facet_wrap(~awareness) +
  geom_col(position = "dodge", colour = "black") +
  geom_errorbar(mapping = aes(min = mean_anx - se_anx, max = mean_anx + se_anx), width = 0, position = position_dodge(.9)) +
  scale_fill_manual(values = c("zero" = "#ff0000", "fifty" = "#0dca41", "hundred" = "#002fff", "amb" = "#7b21d1"),
                     labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred", "amb" = "Ambiguous")) +
  scale_linetype_discrete(labels = c("high" = "High Anxious", "low" = "Low Anxious")) +
  scale_x_discrete(labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred", "amb" = "Ambiguous")) + 
  labs(x = "CS",
       y = "Anxiety") +
  theme_minimal() +
  theme(axis.line.y = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.y = element_line(colour = "black", size = 0.5),
        axis.line.x.bottom = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.length = unit(-0.1, "cm"),
        axis.line.x = element_line(colour = "black", linewidth = 0.5),
        panel.grid = element_blank(),
        legend.title = element_blank(),
        legend.key = element_blank())

print(TA_anx_test_plot)

Aware TA expectancy

TA_exp_test_data <- plot_data %>% 
  filter(trial > 32, PID != 18) %>% 
  group_by(typev2, TA, awareness) %>% 
  summarise(mean_anx = mean(anx2),
            mean_SCL = mean(log(SCL2 + 1)),
            se_anx = sd(anx2)/sqrt(n()),
            se_SCL = sd(log(SCL2 + 1))/sqrt(n())) %>% 
  ungroup()


TA_exp_test_plot <- ggplot(data = TA_exp_test_data, mapping = aes(x = typev2, y = mean_anx, fill = typev2, linetype = TA)) +
  facet_wrap(~awareness) +
  geom_col(position = "dodge", colour = "black") +
  geom_errorbar(mapping = aes(min = mean_anx - se_anx, max = mean_anx + se_anx), width = 0, position = position_dodge(.9)) +
  scale_fill_manual(values = c("zero" = "#ff0000", "fifty" = "#0dca41", "hundred" = "#002fff", "amb" = "#7b21d1"),
                     labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred", "amb" = "Ambiguous")) +
  scale_linetype_discrete(labels = c("high" = "High Anxious", "low" = "Low Anxious")) +
  scale_x_discrete(labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred", "amb" = "Ambiguous")) + 
  labs(x = "CS",
       y = "Expectancy") +
  theme_minimal() +
  theme(axis.line.y = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.y = element_line(colour = "black", size = 0.5),
        axis.line.x.bottom = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.length = unit(-0.1, "cm"),
        axis.line.x = element_line(colour = "black", linewidth = 0.5),
        panel.grid = element_blank(),
        legend.title = element_blank(),
        legend.key = element_blank())

print(TA_exp_test_plot)

Aware TA SCL

TA_SCL_test_data <- plot_data %>% 
  filter(trial > 26, PID != 18) %>% 
  group_by(typev2, TA, awareness) %>% 
  summarise(mean_anx = mean(anx2),
            mean_SCL = mean(log(SCL2 + 1)),
            se_anx = sd(anx2)/sqrt(n()),
            se_SCL = sd(log(SCL2 + 1))/sqrt(n())) %>% 
  ungroup()


TA_SCL_test_plot <- ggplot(data = TA_SCL_test_data, mapping = aes(x = typev2, y = mean_SCL, fill = typev2, linetype = TA)) +
  facet_wrap(~awareness) +
  geom_col(position = "dodge", colour = "black") +
  geom_errorbar(mapping = aes(min = mean_SCL - se_SCL, max = mean_SCL + se_SCL), width = 0, position = position_dodge(.9)) +
  scale_fill_manual(values = c("zero" = "#ff0000", "fifty" = "#0dca41", "hundred" = "#002fff", "amb" = "#7b21d1"),
                     labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred", "amb" = "Ambiguous")) +
  scale_linetype_discrete(labels = c("high" = "High Anxious", "low" = "Low Anxious")) +
  scale_x_discrete(labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred", "amb" = "Ambiguous")) + 
  labs(x = "CS",
       y = "SCL") +
  theme_minimal() +
  theme(axis.line.y = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.y = element_line(colour = "black", size = 0.5),
        axis.line.x.bottom = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.length = unit(-0.1, "cm"),
        axis.line.x = element_line(colour = "black", linewidth = 0.5),
        panel.grid = element_blank(),
        legend.title = element_blank(),
        legend.key = element_blank())

print(TA_SCL_test_plot)

Aware IU Acquisition

IUS_acq_data <- plot_data %>% 
  filter(trial < 29, PID != 18) %>% 
  group_by(typev2, exptrial, IUS, awareness) %>% 
  summarise(mean_anx = mean(anx2),
            mean_SCL = mean(log(SCL2 + 1)),
            se_anx = sd(anx2)/sqrt(n()),
            se_SCL = sd(log(SCL2 + 1))/sqrt(n())) %>% 
  ungroup()

IUS_anx_acq_plot <- ggplot(data = IUS_acq_data, mapping = aes(x = exptrial, y = mean_anx, col = typev2)) +
  facet_wrap(~awareness) +
  geom_line(mapping = aes(linetype = IUS)) +
  geom_point(mapping = aes(shape = IUS)) +
  geom_errorbar(mapping = aes(min = mean_anx - se_anx, max = mean_anx + se_anx), width = 0.1) +
  scale_color_manual(values = c("zero" = "#ff0000", "fifty" = "#0dca41", "hundred" = "#002fff"),
                     labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred")) +
  scale_linetype_discrete(labels = c("high" = "High IU", "low" = "Low IU")) +
  scale_shape_discrete(labels = c("high" = "High IU", "low" = "Low IU")) +
  labs(x = "Trial",
       y = "Anxiety") +
  scale_x_continuous(breaks = c(1, 2, 3, 4, 5, 6)) +
  theme_minimal() +
  theme(axis.line.y = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.y = element_line(colour = "black", size = 0.5),
        axis.line.x.bottom = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.x.bottom = element_line(colour = "black", size = 0.5),
        axis.ticks.length = unit(-0.1, "cm"),
        axis.line.x = element_line(colour = "black", linewidth = 0.5),
        panel.grid = element_blank(),
        legend.title = element_blank(),
        legend.key = element_blank())

print(IUS_anx_acq_plot)

IUS_SCL_acq_plot <- ggplot(data = IUS_acq_data, mapping = aes(x = exptrial, y = mean_SCL, col = typev2)) +
  facet_wrap(~awareness) +
  geom_line(mapping = aes(linetype = IUS)) +
  geom_point(mapping = aes(shape = IUS)) +
  geom_errorbar(mapping = aes(min = mean_SCL - se_SCL, max = mean_SCL + se_SCL), width = 0.1) +
  scale_color_manual(values = c("zero" = "#ff0000", "fifty" = "#0dca41", "hundred" = "#002fff"),
                     labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred")) +
  scale_linetype_discrete(labels = c("high" = "High IU", "low" = "Low IU")) +
  scale_shape_discrete(labels = c("high" = "High IU", "low" = "Low IU")) +
  labs(x = "Trial",
       y = "SCL") +
  scale_x_continuous(breaks = c(1, 2, 3, 4, 5, 6)) +
  theme_minimal() +
  theme(axis.line.y = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.y = element_line(colour = "black", size = 0.5),
        axis.line.x.bottom = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.x.bottom = element_line(colour = "black", size = 0.5),
        axis.ticks.length = unit(-0.1, "cm"),
        axis.line.x = element_line(colour = "black", linewidth = 0.5),
        panel.grid = element_blank(),
        legend.title = element_blank(),
        legend.key = element_blank())

print(IUS_SCL_acq_plot)

Aware IU test anxiety

IUS_anx_test_data <- plot_data %>% 
  filter(trial > 26 & trial < 33, PID != 18) %>% 
  group_by(typev2, IUS, awareness) %>% 
  summarise(mean_anx = mean(anx2),
            mean_SCL = mean(log(SCL2 + 1)),
            se_anx = sd(anx2)/sqrt(n()),
            se_SCL = sd(log(SCL2 + 1))/sqrt(n())) %>% 
  ungroup()


IUS_anx_test_plot <- ggplot(data = IUS_anx_test_data, mapping = aes(x = typev2, y = mean_anx, fill = typev2, linetype = IUS)) +
  facet_wrap(~awareness) +
  geom_col(position = "dodge", colour = "black") +
  geom_errorbar(mapping = aes(min = mean_anx - se_anx, max = mean_anx + se_anx), width = 0, position = position_dodge(.9)) +
  scale_fill_manual(values = c("zero" = "#ff0000", "fifty" = "#0dca41", "hundred" = "#002fff", "amb" = "#7b21d1"),
                     labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred", "amb" = "Ambiguous")) +
  scale_linetype_discrete(labels = c("high" = "High IU", "low" = "Low IU")) +
  scale_x_discrete(labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred", "amb" = "Ambiguous")) + 
  labs(x = "CS",
       y = "Anxiety") +
  theme_minimal() +
  theme(axis.line.y = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.y = element_line(colour = "black", size = 0.5),
        axis.line.x.bottom = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.length = unit(-0.1, "cm"),
        axis.line.x = element_line(colour = "black", linewidth = 0.5),
        panel.grid = element_blank(),
        legend.title = element_blank(),
        legend.key = element_blank())

print(IUS_anx_test_plot)

Aware TA expectancy

IUS_exp_test_data <- plot_data %>% 
  filter(trial > 32, PID != 18) %>% 
  group_by(typev2, IUS, awareness) %>% 
  summarise(mean_anx = mean(anx2),
            mean_SCL = mean(log(SCL2 + 1)),
            se_anx = sd(anx2)/sqrt(n()),
            se_SCL = sd(log(SCL2 + 1))/sqrt(n())) %>% 
  ungroup()

IUS_exp_test_plot <- ggplot(data = IUS_exp_test_data, mapping = aes(x = typev2, y = mean_anx, fill = typev2, linetype = IUS)) +
  facet_wrap(~awareness) +
  geom_col(position = "dodge", colour = "black") +
  geom_errorbar(mapping = aes(min = mean_anx - se_anx, max = mean_anx + se_anx), width = 0, position = position_dodge(.9)) +
  scale_fill_manual(values = c("zero" = "#ff0000", "fifty" = "#0dca41", "hundred" = "#002fff", "amb" = "#7b21d1"),
                     labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred", "amb" = "Ambiguous")) +
  scale_linetype_discrete(labels = c("high" = "High IU", "low" = "Low IU")) +
  scale_x_discrete(labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred", "amb" = "Ambiguous")) + 
  labs(x = "CS",
       y = "Expectancy") +
  theme_minimal() +
  theme(axis.line.y = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.y = element_line(colour = "black", size = 0.5),
        axis.line.x.bottom = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.length = unit(-0.1, "cm"),
        axis.line.x = element_line(colour = "black", linewidth = 0.5),
        panel.grid = element_blank(),
        legend.title = element_blank(),
        legend.key = element_blank())

print(IUS_exp_test_plot)

Aware TA SCL

IUS_SCL_test_data <- plot_data %>% 
  filter(trial > 26, PID != 18) %>% 
  group_by(typev2, IUS, awareness) %>% 
  summarise(mean_anx = mean(anx2),
            mean_SCL = mean(log(SCL2 + 1)),
            se_anx = sd(anx2)/sqrt(n()),
            se_SCL = sd(log(SCL2 + 1))/sqrt(n())) %>% 
  ungroup()


IUS_SCL_test_plot <- ggplot(data = IUS_SCL_test_data, mapping = aes(x = typev2, y = mean_SCL, fill = typev2, linetype = IUS)) +
  facet_wrap(~awareness) +
  geom_col(position = "dodge", colour = "black") +
  geom_errorbar(mapping = aes(min = mean_SCL - se_SCL, max = mean_SCL + se_SCL), width = 0, position = position_dodge(.9)) +
  scale_fill_manual(values = c("zero" = "#ff0000", "fifty" = "#0dca41", "hundred" = "#002fff", "amb" = "#7b21d1"),
                     labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred", "amb" = "Ambiguous")) +
  scale_linetype_discrete(labels = c("high" = "High IU", "low" = "Low IU")) +
  scale_x_discrete(labels = c("zero" = "Zero", "fifty" = "Fifty", "hundred" = "Hundred", "amb" = "Ambiguous")) + 
  labs(x = "CS",
       y = "SCL") +
  theme_minimal() +
  theme(axis.line.y = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.y = element_line(colour = "black", size = 0.5),
        axis.line.x.bottom = element_line(colour = "black", linewidth = 0.5),
        axis.ticks.length = unit(-0.1, "cm"),
        axis.line.x = element_line(colour = "black", linewidth = 0.5),
        panel.grid = element_blank(),
        legend.title = element_blank(),
        legend.key = element_blank())

print(IUS_SCL_test_plot)