CSV Data File

First step is the load the data into R, which is this CSV file: FakeData.

library(readr)
FakeData <- read_csv("FakeData.csv")
## Parsed with column specification:
## cols(
##   .default = col_character(),
##   Subject = col_double(),
##   Trial = col_double(),
##   Color_Level = col_double(),
##   PT_Split = col_double()
## )
## See spec(...) for full column specifications.
View(FakeData)

R Programs

Here are the R programs I used to wrangle and visualize the data. Note if you do not have these programs, you can easily install them.

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(ggplot2)
## Warning: package 'ggplot2' was built under R version 3.6.3
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 tibble  2.1.3     v stringr 1.4.0
## v tidyr   1.0.0     v forcats 0.4.0
## v purrr   0.3.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()

Specifying Factorial & Numeric Variables

I defined the variables as factor or numeric, which is an important distinction in R.

FakeData <- FakeData %>%  
  mutate(Color_Level = as.factor(Color_Level),
         Experiment_Name = as.factor(Experiment_Name),
         Subject = as.factor(Subject),
         P_Color=as.factor(P_Color),
         P_Present=as.factor(P_Present),
         PT_Split=as.factor(PT_Split), 
         CC_R=as.factor(CC_R), 
         CP_R1=as.factor(CP_R1),
         CP_R2=as.factor(CP_R2), 
         SC_R=as.factor(SC_R),
         SP_R=as.factor(SP_R),
         SP_R2=as.factor(SP_R2),
         Central_Pair=as.factor(Central_Pair),
         Display_Code=as.factor(Display_Code),
         SC_RT=as.numeric(SC_RT),
         SP_RT=as.numeric(SP_RT), 
         SP_RT2=as.numeric(SP_RT2)) 
## Warning: NAs introduced by coercion

## Warning: NAs introduced by coercion

## Warning: NAs introduced by coercion

Missing Data

We will likely have missing values during the actual experiment, so I intentionally created a dataset with missing values.

Viewing Subjects with Missing Data

MissingValuesSubject<-filter(FakeData, SC_R =="n/a" | SP_R=="n/a")
MissingValuesSubject

Removed Missing Data

I removed these missing values and created a new data frame called FakeData2.

FakeData2<-filter(FakeData, SC_R != "n/a"& SP_R!= "n/a")

Variable Order

Here I specified the order of the factor variables (default is alphabetical order). This step will help with data visualization.

FakeData2$Experiment_Name <-factor(FakeData2$Experiment_Name,levels=c("No_LEP","LEP"))
FakeData2$CC_R <-factor(FakeData2$CC_R,levels=c("S","D"))
FakeData2$SC_R <-factor(FakeData2$SC_R,levels=c("S","D"))
FakeData2$CP_R1 <-factor(FakeData2$CP_R1,levels=c("P","A"))
FakeData2$SP_R <-factor(FakeData2$SP_R,levels=c("P","A"))

Response Bias Visualization

I deliberately created response biases in the fake dataset. During the LEP condition, my fake subjects reported that the central targets appeared more similar than different and that the peripheral targets appeared more absent than present. These response biases occurred for color levels seven and eight.

To visualize response bias, I suggest first looking at bar charts. The x-axis represents the color level, and the y-axis represents the proportion. I think this step is important before we do anything (e.g., aggregating) to our data.

FakeData2 %>%
  ggplot(aes(Color_Level, fill = SC_R)) +  
  geom_bar(position = "fill")+
  scale_fill_manual(values=c("darkgreen","grey42"))+
  facet_grid(~Experiment_Name)+
  theme_minimal() + 
  geom_hline(yintercept=.5)+
  theme(legend.position="top")+
  labs(
    fill = "Same/Different",
    title    = "Visual Effects Experiment", 
    subtitle = "Central Responses",
    y        = "Proportion",
    x        = "Color Level")

FakeData2 %>%
  ggplot(aes(Color_Level, fill = SP_R)) +  
  geom_bar(position = "fill")+
  facet_grid(~Experiment_Name)+
  scale_fill_manual(values=c("grey42","darkgreen"))+
  theme_minimal() + 
  geom_hline(yintercept=.5)+
  theme(legend.position="top")+
  labs(
    fill = "Present/Absent",
    title    = "Visual Effects Experiment", 
    subtitle = "Peripheral Responses",
    y        = "Proportion",
    x        = "Color Level")

Performance Scores

I created performance scores that we can later use (after data aggregation) to measure accuracy for the central task (C_Score) and peripheral task (P_Score). These scores are based on whether the subject response matches the correct answer.

FakeData2 <- FakeData2 %>% 
mutate(C_Score = ifelse(CC_R == "S" & SC_R =="S" | CC_R == "D" & SC_R =="D", 1,0))

FakeData2 <- FakeData2 %>% 
mutate(P_Score = ifelse(CP_R1 == "P" & SP_R =="P" | CP_R1 == "A" & SP_R =="A", 1,0))

Quadrants, Top/Bottom, & Left/Right

During the peripheral task, if a subject reported seeing a target present, the secondary response will be to indicate which octant the target appeared. For possible exploratory analyses, I categorized correct and subject responses into quadrants, top/bottom, and left/right.

FakeData2 <- FakeData2 %>% 
mutate(Quadrant_C = ifelse(CP_R2=="n/a","NA",
                    ifelse(CP_R2 == "1" | CP_R2 =="2","Q1",
                    ifelse(CP_R2 == "3" | CP_R2 =="4","Q2", 
                    ifelse(CP_R2 == "5" | CP_R2 =="6","Q3","Q4")))))

FakeData2 <- FakeData2 %>% 
mutate(Top_Bottom_C = ifelse(CP_R2=="n/a","NA",
                      ifelse(CP_R2 == "1" | CP_R2 =="2" | CP_R2 =="7" | CP_R2 =="8", 
                             "Top", "Bottom")))

FakeData2 <- FakeData2 %>% 
mutate(Left_Right_C = ifelse(CP_R2=="n/a","NA",
                      ifelse(CP_R2 == "1" | CP_R2 =="2" | CP_R2 =="3" | CP_R2 =="4", 
                             "Right", "Left")))

FakeData2 <- FakeData2 %>% 
mutate(Quadrant_S = ifelse(SP_R2=="n/a","NA",
                    ifelse(SP_R2 == "1" | SP_R2 =="2","Q1", 
                    ifelse(SP_R2 == "3" | SP_R2 =="4","Q2",
                    ifelse(SP_R2 == "5" | SP_R2 =="6","Q3","Q4")))))

FakeData2 <- FakeData2 %>% 
mutate(Top_Bottom_S = ifelse(SP_R2=="n/a","NA",
                      ifelse(SP_R2 == "1" | SP_R2 =="2" | SP_R2 =="7" | SP_R2 =="8", 
                             "Top","Bottom")))

FakeData2 <- FakeData2 %>% 
mutate(Left_Right_S = ifelse(SP_R2=="n/a","NA",
                             ifelse(SP_R2 == "1" | SP_R2 =="2" | SP_R2 =="3" | SP_R2 =="4", 
                                    "Right","Left")))

Hits, False Alarms, Misses, & Correct Rejections

I categorized the central and peripheral data into hits, false alarms, misses, and correct rejections. The two tables below represent how I coded the data at a conceptual level. For me, I think the same responses on the central task is similar to the absent responses on the peripheral task: the stimuli on both task have the same color.

Central Responses
Correct Different Correct Same
Subject Different Hit Miss
Subject Same False Alarm Correct Rejection
Peripheral Responses
Correct Present Correct Absent
Subject Present Hit Miss
Subject Absent False Alarm Correct Rejection
# Central: Hits, FA, Miss, CR
FakeData2 <- FakeData2 %>% 
mutate(c_hits = ifelse(CC_R == "D" & SC_R == "D", 1,0))

FakeData2 <- FakeData2 %>%  
mutate(c_fa = ifelse(CC_R == "S" & SC_R == "D",1,0))

FakeData2 <- FakeData2 %>% 
mutate(c_miss = ifelse(CC_R == "D" & SC_R == "S", 1,0))

FakeData2 <- FakeData2 %>% 
mutate(c_cr = ifelse(CC_R == "S" & SC_R == "S",1,0))

# Peripheral: Hits, FA, Miss, CR
FakeData2 <- FakeData2 %>% 
mutate(p_hits = ifelse(CP_R1 == "P" & SP_R == "P", 1,0))

FakeData2 <- FakeData2 %>%  
mutate(p_fa = ifelse(CP_R1 == "A" & SP_R == "P",1,0))

FakeData2 <- FakeData2 %>% 
mutate(p_miss = ifelse(CP_R1 == "P" & SP_R == "A", 1,0))

FakeData2 <- FakeData2 %>% 
mutate(p_cr = ifelse(CP_R1 == "A" & SP_R == "A",1,0))

d’, beta, & other calculations

To calculate d’, I used a program in R called psycho. This program calculates d’, the beta, the A’ and the B’’D based on the signal detection theory. Here is the documentation

# central responses
central<-FakeData2%>% 
  select(Experiment_Name,
         Color_Level,
         Subject,
         c_hits,c_fa,c_miss,c_cr)%>% 
  group_by(Experiment_Name,Color_Level,Subject)%>% 
  summarize(Cn_hit=sum(c_hits),
            Cn_fa = sum(c_fa),
            Cn_miss= sum(c_miss),
            Cn_cr = sum(c_cr))
            
c_indices <- psycho::dprime(central$Cn_hit,
                            central$Cn_fa, 
                            central$Cn_miss, 
                            central$Cn_cr,
                            adjusted =TRUE)

central <- cbind(central,c_indices)

central<- central%>% 
mutate(c_accuracy =(Cn_hit+Cn_cr)/(Cn_hit+Cn_cr+Cn_fa+Cn_miss))

central<- central%>% 
mutate(c_sensitivity = (Cn_hit)/(Cn_hit+Cn_miss))

central<- central%>% 
mutate(c_specificity = (Cn_cr)/(Cn_cr+Cn_fa))

central<- central%>% 
mutate(c_False.Pos.Rate = (Cn_fa)/(Cn_fa+Cn_cr))

# Peripheral Responses
peripheral<-FakeData2%>% 
  select(Experiment_Name,
         Color_Level,
         Subject,
         p_hits,p_fa,p_miss,p_cr)%>% 
  group_by(Experiment_Name,Color_Level,Subject)%>% 
  summarize(Pn_hit=sum(p_hits),
            Pn_fa = sum(p_fa),
            Pn_miss= sum(p_miss),
            Pn_cr = sum(p_cr))

p_indices <- psycho::dprime(peripheral$Pn_hit, 
                            peripheral$Pn_fa, 
                            peripheral$Pn_miss, 
                            peripheral$Pn_cr,
                            adjusted =TRUE)

peripheral<- cbind(peripheral,p_indices)

peripheral<- peripheral%>% 
mutate(p_accuracy = (Pn_hit+Pn_cr)/(Pn_hit+Pn_cr+Pn_fa+Pn_miss))

peripheral<- peripheral%>% 
mutate(p_sensitivity = (Pn_hit)/(Pn_hit+Pn_miss))

peripheral<- peripheral%>% 
mutate(p_specificity = (Pn_cr)/(Pn_cr+Pn_fa))

peripheral<- peripheral%>% 
mutate(p_False.Pos.Rate = (Pn_fa)/(Pn_fa+Pn_cr))

# Combined central and peripheral data
central <- central %>% 
  rename(c_dprime =dprime ,
         c_beta = beta,
         c_aprime = aprime,
         c_bppd = bppd,
         c_c = c)

peripheral<- peripheral%>% 
  rename(p_dprime =dprime ,
         p_beta = beta,
         p_aprime = aprime,
         p_bppd = bppd,
         p_c = c)

combined<-merge(central,peripheral, by =c('Experiment_Name',
                                          'Color_Level', 
                                          'Subject'))

Boxplots & Color Selection

I like using boxplots. We can spot subject outliers and see the variation. I included mean values (green dots) in these boxplots (note boxplots do not include means). I can easily eliminate these green dots if these boxplots appear too busy.

I found a website that produces R code by entering RGB values. You can also change the level of saturation. I picked different shades of red. Once we determine what colors (using this term loosely) we will use, we can use them in all of our figures.

combined %>%
  ggplot(aes(Color_Level, c_dprime, 
             fill = Color_Level))+
  geom_boxplot()+
  stat_summary(fun=mean, geom="point", 
               shape=20, size=2, 
               color="green", fill="green", alpha =.6)+
  facet_grid(~Experiment_Name)+
  scale_fill_manual(values=c("#FF0000",
                             "#FF4D4D",
                             "#FF5A5A",
                             "#FF6666",
                             "#FF8080",
                             "#FF9A9A",
                             "#FFB3B3",
                             "#FFE6E6"))+
  xlab("Color Level")+
  geom_hline(yintercept=0)+
  theme_dark()+
  theme(legend.position = "none")+
  labs(                         
    title    = "Visual Effects Experiment", 
    subtitle = "Central Response: d prime",
    y        = "d prime",
    x        = "Color Level")

combined %>%
  ggplot(aes(Color_Level, c_beta, 
             fill = Color_Level))+
  geom_boxplot()+
  stat_summary(fun=mean, geom="point", 
               shape=20, size=2, 
               color="green", fill="green", alpha =.6)+
  facet_grid(~Experiment_Name)+
  scale_fill_manual(values=c("#FF0000",
                             "#FF4D4D",
                             "#FF5A5A",
                             "#FF6666",
                             "#FF8080",
                             "#FF9A9A",
                             "#FFB3B3",
                             "#FFE6E6"))+
  xlab("Color Level")+
  geom_hline(yintercept=1)+
  theme_dark()+
  theme(legend.position = "none")+
  labs(                         
    title    = "Visual Effects Experiment", 
    subtitle = "Central Response: beta",
    y        = "beta",
    x        = "Color Level")

combined %>%
  ggplot(aes(Color_Level, p_dprime, 
             fill = Color_Level))+
  geom_boxplot()+
  stat_summary(fun=mean, geom="point", 
               shape=20, size=2, 
               color="green", fill="green", alpha =.6)+
  facet_grid(~Experiment_Name)+
  scale_fill_manual(values=c("#FF0000",
                             "#FF4D4D",
                             "#FF5A5A",
                             "#FF6666",
                             "#FF8080",
                             "#FF9A9A",
                             "#FFB3B3",
                             "#FFE6E6"))+
  xlab("Color Level")+
  geom_hline(yintercept=0)+
  theme_dark()+
  theme(legend.position = "none")+
  labs(                         
    title    = "Visual Effects Experiment", 
    subtitle = "Peripheral Response: d prime",
    y        = "d prime",
    x        = "Color Level")

combined %>%
  ggplot(aes(Color_Level, c_beta, 
             fill = Color_Level))+
  geom_boxplot()+
  stat_summary(fun=mean, geom="point", 
               shape=20, size=2, 
               color="green", fill="green", alpha =.6)+
  facet_grid(~Experiment_Name)+
  scale_fill_manual(values=c("#FF0000",
                             "#FF4D4D",
                             "#FF5A5A",
                             "#FF6666",
                             "#FF8080",
                             "#FF9A9A",
                             "#FFB3B3",
                             "#FFE6E6"))+
  xlab("Color Level")+
  geom_hline(yintercept=1)+
  theme_dark()+
  theme(legend.position = "none")+
  labs(                         
    title    = "Visual Effects Experiment", 
    subtitle = "Central Response: beta",
    y        = "beta",
    x        = "Color Level")

Aggregating Data

We can aggregate our data into different levels in R. The following code aggregates data by experiment (No LEP vs. LEP) and color level (1-8).

combined.agg<-combined%>% 
  group_by(Experiment_Name,Color_Level)%>% 
  summarize(c_tpr.M=mean(c_sensitivity),
            c_tpr.SD = sd(c_sensitivity),
            c_fpr.M=mean(c_False.Pos.Rate),
            c_fpr.SD=sd(c_False.Pos.Rate),
            p_tpr.M=mean(p_sensitivity),
            p_tpr.SD = sd(p_sensitivity),
            p_fpr.M=mean(p_False.Pos.Rate),
            p_fpr.SD=sd(p_False.Pos.Rate),
            c_dprime.M=mean(c_dprime),
            c_dprime.SD = sd(c_dprime),
            c_accuracy.M=mean(c_accuracy),
            c_accuracy.SD=sd(c_accuracy),
            p_dprime.M=mean(p_dprime),
            p_dprime.SD = sd(p_dprime),
            p_accuracy.M=mean(p_accuracy),
            p_accuracy.SD=sd(p_accuracy),
            c_beta.M=mean(c_beta),
            c_beta.SD=sd(c_beta),
            p_beta.M=mean(p_beta),
            p_beta.SD=sd(p_beta),
            Count= n())
# adding standard errors
combined.agg<- combined.agg%>% 
  mutate(c_tpr.SE = c_tpr.SD/sqrt(Count),
         c_fpr.SE = c_fpr.SD/sqrt(Count),
         c_dprime.SE = c_dprime.SD/sqrt(Count),
         c_accuracy.SE = c_accuracy.SD/sqrt(Count),
         p_tpr.SE = c_tpr.SD/sqrt(Count),
         p_fpr.SE = c_fpr.SD/sqrt(Count),
         p_dprime.SE = c_dprime.SD/sqrt(Count),
         p_accuracy.SE = c_accuracy.SD/sqrt(Count),
         p_beta.SE=p_beta.SD/sqrt(Count),
         p_beta.SE=p_beta.SD/sqrt(Count),
         c_beta.SE=c_beta.SD/sqrt(Count),
         c_beta.SE=c_beta.SD/sqrt(Count))

ROC Figures

I created ROC figures that we might use. The y-axis represents the True Positive Rate (sensitivity), the x-axis represents False Positive Rate (1- specificity), and the dotted green diagonal line represents chance. The shapes in these figures refer to the experiment (No LEP vs. LEP), with circles representing No LEP and squares representing LEP. I plotted 16 means (8 color levels x 2 experiment). To help see the changes from No LEP to LEP for each color level, I included solid gray lines.

Note we could create other ROC figures, such as figuring out a way to include ROC curves, which would give us AUC (area under the curve). However, I would like to discuss to issue more before writing more code.

combined.agg %>%
  ggplot(aes(c_fpr.M,c_tpr.M,
             color = Color_Level, shape = Experiment_Name)) +
  geom_point(aes(fill=Color_Level),size=3) +
  geom_line(aes(group = Color_Level),color="grey")+
  scale_color_manual(values=c("#FF0000",
                              "#FF4D4D",
                              "#FF5A5A",
                              "#FF6666",
                              "#FF8080",
                              "#FF9A9A",
                              "#FFB3B3",
                              "#FFE6E6"))+
  theme(legend.position = "bottom")+
  theme_dark()+
  labs(
    title    = "Visual Effects Experiment", 
    subtitle = "Central Response: ROC",
    y        = "True Positive Rate",
    x        = "False Positive Rate")+
  geom_abline(intercept = 0, slope = 1, 
              color ="green",linetype = "dashed")

combined.agg %>%
  ggplot(aes(p_fpr.M,p_tpr.M,
             color = Color_Level, shape = Experiment_Name)) +
  geom_point(aes(fill=Color_Level),size=3) +
  geom_line(aes(group = Color_Level),color="grey")+
  scale_color_manual(values=c("#FF0000",
                              "#FF4D4D",
                              "#FF5A5A",
                              "#FF6666",
                              "#FF8080",
                              "#FF9A9A",
                              "#FFB3B3",
                              "#FFE6E6"))+
  theme(legend.position = "bottom")+
  theme_dark()+
  labs(                         
    title    = "Visual Effects Experiment", 
    subtitle = "Peripheral Response: ROC",
    y        = "True Positive Rate",
    x        = "False Positive Rate")+
  geom_abline(intercept = 0, slope = 1, 
              color ="green",linetype = "dashed")

Line Graphs

I generated line graphs to represent our data at this level of aggregations. The following is a sample of what we can do.

ggplot(combined.agg, aes(x=Color_Level, y=c_accuracy.M, 
                         color=Experiment_Name, 
                         group=Experiment_Name, 
                         linetype=Experiment_Name)) + 
  geom_line(size=1, alpha= .7)+
  geom_point(size=2,alpha=.5)+
  geom_errorbar(aes(ymin=c_accuracy.M -c_accuracy.SE,
                    ymax=c_accuracy.M+c_accuracy.SE),
                size=.5,    
                width=.1, 
                color="black", 
                linetype="solid",
                alpha=.7) +
  scale_color_manual(values=c("blue","red"))+
  geom_hline(yintercept=.50)+
  theme(legend.position="top")+
  theme_bw()+
  labs(
    title    = "Visual Effects Experiment", 
    subtitle = "Central Responses: Accuracy",
    y        = "Accuracy",
    x        = "Color Level")

ggplot(combined.agg, aes(x=Color_Level, y=p_accuracy.M, 
                         color=Experiment_Name, 
  group=Experiment_Name, linetype=Experiment_Name)) + 
  geom_line(size=1, alpha= .7)+
  geom_point(size=2,alpha=.5)+
  geom_errorbar(aes(ymin=p_accuracy.M -p_accuracy.SE,
                    ymax=p_accuracy.M+p_accuracy.SE),
                size=.5,    
                width=.1, 
                color="black", 
                linetype="solid",
                alpha=.7) +
  scale_color_manual(values=c("blue","red"))+
  geom_hline(yintercept=.50)+
  theme_bw()+
  labs(                         
    title    = "Visual Effects Experiment", 
    subtitle = "Peripheral Responses: Accuracy",
    y        = "Accuracy",
    x        = "Color Level")

ggplot(combined.agg, aes(x=Color_Level, y=c_dprime.M, 
                         color=Experiment_Name, 
                         group=Experiment_Name, 
                         linetype=Experiment_Name)) + 
  geom_line(size=1, alpha= .7)+
  geom_point(size=2,alpha=.5)+
  geom_errorbar(aes(ymin=c_dprime.M -c_dprime.SE,
                    ymax=c_dprime.M+c_dprime.SE),
                size=.5,    
                width=.1, 
                color="black", 
                linetype="solid",
                alpha=.7) +
  scale_color_manual(values=c("blue","red"))+
  geom_hline(yintercept=0)+
  theme_bw()+
  labs(                         
    title    = "Visual Effects Experiment", 
    subtitle = "Central Responses: d prime",
    y        = "d prime",
    x        = "Color Level")

ggplot(combined.agg, aes(x=Color_Level, y=p_dprime.M, 
                         color=Experiment_Name, 
                         group=Experiment_Name, 
                         linetype=Experiment_Name)) + 
  geom_line(size=1, alpha= .7)+
  geom_point(size=2,alpha=.5)+
  geom_errorbar(aes(ymin=p_dprime.M -p_dprime.SE,
                    ymax=p_dprime.M+p_dprime.SE),
                size=.5,    
                width=.1, 
                color="black", 
                linetype="solid",
                alpha=.7) +
  scale_color_manual(values=c("blue","red"))+
  geom_hline(yintercept=0)+
  theme_bw()+
  labs(                         
    title    = "Visual Effects Experiment", 
    subtitle = "Peripheral Responses: d prime",
    y        = "d prime",
    x        = "Color Level")

ggplot(combined.agg, aes(x=Color_Level, y=c_beta.M, 
                         color=Experiment_Name, 
                         group=Experiment_Name, 
                         linetype=Experiment_Name)) + 
  geom_line(size=1, alpha= .7)+
  geom_point(size=2,alpha=.5)+
  geom_errorbar(aes(ymin=c_beta.M -c_beta.SE,
                    ymax=c_beta.M+c_beta.SE),
                size=.5,    
                width=.1, 
                color="black", 
                linetype="solid",
                alpha=.7) +
  scale_color_manual(values=c("blue","red"))+
  geom_hline(yintercept=1)+
  theme_bw()+
  labs(                         
    title    = "Visual Effects Experiment", 
    subtitle = "Central Responses: beta",
    y        = "beta",
    x        = "Color Level")

ggplot(combined.agg, aes(x=Color_Level, y=p_beta.M, 
                         color=Experiment_Name, 
                         group=Experiment_Name, 
                         linetype=Experiment_Name)) + 
  geom_line(size=1, alpha= .7)+
  geom_point(size=2,alpha=.5)+
  geom_errorbar(aes(ymin=p_beta.M -p_beta.SE,
                    ymax=p_beta.M+p_beta.SE),
                size=.5,    
                width=.1, 
                color="black", 
                linetype="solid",
                alpha=.7) +
  scale_color_manual(values=c("blue","red"))+
  geom_hline(yintercept=1)+
  theme_bw()+
  labs(                         
    title    = "Visual Effects Experiment", 
    subtitle = "Peripheral Responses: beta",
    y        = "beta",
    x        = "Color Level")