library(dplyr)
## Warning: package 'dplyr' was built under R version 3.6.2
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(psycho)
## Warning: package 'psycho' was built under R version 3.6.3
## Note: Many functions of the 'psycho' package have been (improved and) moved to other packages of the new 'easystats' collection (https://github.com/easystats). If you don't find where a function is gone, please open an issue at: https://github.com/easystats/easystats/issues
library(tidyverse)
## Warning: package 'tidyverse' was built under R version 3.6.3
## -- Attaching packages ----------------------------------------------------------------------------------------------- tidyverse 1.3.0 --
## v ggplot2 3.3.2     v purrr   0.3.3
## v tibble  2.1.3     v stringr 1.4.0
## v tidyr   1.0.0     v forcats 0.4.0
## v readr   1.3.1
## Warning: package 'ggplot2' was built under R version 3.6.3
## Warning: package 'tidyr' was built under R version 3.6.2
## Warning: package 'purrr' was built under R version 3.6.2
## -- Conflicts -------------------------------------------------------------------------------------------------- tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag()    masks stats::lag()
library(readxl)

Visual_Effects_Null <- read_excel("~/Andrew Mojica/Projects/Visual Effects Experiment/Visual_Effects_Null.xlsx")
View(Visual_Effects_Null)
# Define "Variables as factor
Visual_Effects_Null$Color_Level<-factor(Visual_Effects_Null$Color_Level, levels=c("1","2","3","4","5","6",
                                              "7","8"))

R Markdown

dprime

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)

Including Plots

Scatterplot and Boxplot

# Scatterplot
ggplot(Visual_Effects_Null, 
       aes(n_fa, n_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()