b1 <- ggplot(df, aes(x=Reward, y=Mean_diffs, group=Distraction, fill=Distraction))+
geom_bar(stat="identity", position="dodge")+
theme_classic()+
ylab("Mean # spotted")+
xlab("Reward Condition")
b2 <- ggplot(df, aes(x=Distraction, y=Mean_diffs, group=Reward, fill=Reward))+
geom_bar(stat="identity", position="dodge")+
theme_classic()+
ylab("Mean # spotted")+
xlab("Distraction Condition")
l1 <- ggplot(df, aes(x=Reward, y=Mean_diffs, group=Distraction, color=Distraction))+
geom_line()+
geom_point()+
theme_classic()+
ylab("Mean # spotted")+
xlab("Reward Condition")
l2 <- ggplot(df, aes(x=Distraction, y=Mean_diffs, group=Reward, color=Reward))+
geom_line()+
geom_point()+
theme_classic()+
ylab("Mean # spotted")+
xlab("Distraction Condition")
ggarrange(b1,b2,l1,l2, ncol=2, nrow=2)
Section 9.3 Graphing the means
In our example above we showed you two bar graphs of the very same means for our 2x2 design. Even though the graphs plot identical means, they look different, so they are more or less easy to interpret by looking at them. Results from 2x2 designs are also often plotted with line graphs. Those look different too. There are four different graphs in Figure 9.3.2, using bars and lines to plot the very same means from before. We are showing you this so that you realize how you graph your data matters because it makes it more or less easy for people to understand the results. Also, how the data is plotted matters for what you need to look at to interpret the results.
Remark 9.3.1. R Code.


