I am doing an eye-tracking experiment trying to find out the influence of two languages on the fixation proportions of participants on two different Areas of interest (AOIs), along the time.
My independent variables: Language (L1 vs. L2), AOI (AOI1 vs. AOI2), and time (divided into 50 time bins already). I want to plot a graph with four lines, each line stands for the fixation percentage of "L1 AOI1", "L1 AOI2", "L2 AOI1" and "L2 AOI2". An example of my data.frame is as follows:
Stimulus Bin Language AOI percentage
1 1 L1 AOI1 0.75
1 1 L1 AOI2 0.12
1 1 L2 AOI1 0.54
1 1 L2 AOI2 0.36
...
10 1 L1 AOI1 0.85
10 1 L1 AOI2 0.10
10 1 L2 AOI1 0.60
10 1 L2 AOI2 0.23
...
10 7 L1 AOI1 0.64
10 7 L1 AOI2 0.14
10 7 L2 AOI1 0.66
10 7 L2 AOI2 0.21
...
I think I do not need to melt my data, right? because it is already in a long format.
I have draw two graphs with facet_wrap as follows, but how could I get ONE graph with all those information?
ggplot(data,aes(Bin, percentage, linetype = Language)) +`enter code here`
facet_wrap(~ AOI)+
stat_summary(fun.y = mean,geom = "line")+
stat_summary(fun.data = mean_se,geom = "ribbon",
color = NA, alpha = 0.3) +
theme_bw(base_size = 10) +
labs(x = "2000 ms since picture onset (50 time bins)",
y = "fixation proportion") +
scale_linetype_manual(values = c("solid","dashed"))
Any ideas would be of great help to me.
Thanks!