Stats programs I used and defining color level variable as a factor variable.

Defining Factors

# Define "Variables as factor
Visual_Effects_Null <- Visual_Effects_Null %>%  ### this variable means it writes over
  mutate(Color_Level = as.factor(Color_Level), 
         Subject = as.factor(Subject))

d’

I used a stats program (psycho) to calculate d’. After these scores were calculated, I combined into the same data frame.

indices <- psycho::dprime(Visual_Effects_Null$n_hit, Visual_Effects_Null$n_fa, Visual_Effects_Null$n_miss, Visual_Effects_Null$n_cr)
Visual_Effects_Null <- cbind(Visual_Effects_Null, indices)

Percent

Visual_Effects_Null <- Visual_Effects_Null %>% 
  mutate(
    Overall_Accuracy = (n_hit+n_cr)/(n_hit+n_cr+n_fa+n_miss)
  )

Visual_Effects_Null <- Visual_Effects_Null %>% 
  mutate(
    p_hit = (n_hit)/(n_hit+n_miss)
  )

Visual_Effects_Null <- Visual_Effects_Null %>% 
  mutate(
    p_fa = (n_fa)/(n_fa+n_cr)
  )
Visual_Effects_Null <- Visual_Effects_Null %>% 
  mutate(
    p_miss = (n_miss)/(n_miss+n_hit)
  )
Visual_Effects_Null <- Visual_Effects_Null %>% 
  mutate(
    p_cr = (n_cr)/(n_cr+n_fa)
  )

Plots

# Scatterplot
ggplot(Visual_Effects_Null, 
       aes(p_fa, p_hit,
           color = Color_Level)) +
  geom_jitter(size = 3, alpha =.75) +
  theme(legend.position = "bottom")+
  theme_bw()+
  geom_hline(yintercept=0)+
  geom_vline(xintercept=0)+
  scale_y_continuous(name="# Hits")+
  scale_x_continuous(name="# False Alarms")

# Boxlplot
Visual_Effects_Null %>%
  ggplot(aes(Color_Level, dprime)) + 
  geom_boxplot() +
  xlab("") +
  theme(legend.position = "bottom")+
  theme_bw()

# Density plot
Visual_Effects_Null %>%
  ggplot(aes(x = dprime, 
             fill = Color_Level))+
  geom_density(alpha = 0.7) +
  theme(legend.position = "bottom")+
  theme_bw()

Visual_Effects_Null %>%
  ggplot(aes(x = Overall_Accuracy, 
             fill = Color_Level))+
  geom_density(alpha = 0.7) +
  theme(legend.position = "bottom")+
  theme_bw()

Visual_Effects_Null %>%
  ggplot(aes(x = beta, 
             fill = Color_Level))+
  geom_density(alpha = 0.7) +
  theme(legend.position = "bottom")+
  theme_bw()

# Histogram plot
Visual_Effects_Null %>%
  ggplot(aes(x = dprime, 
             fill = Color_Level))+
  geom_histogram(alpha = 0.7) +
  geom_vline(xintercept=0)+
  #facet_grid(Color_Level~.)+
  theme(legend.position = "bottom")+
  theme_bw()
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.