Tutorial/R code for creating plots for 2-way interactions

Edit this page

Abstract

ggplot2, as I’ve already made clear, is one of my favourite packages for R. And since that original post about ggplot2 remains one of my most frequently visited, I thought I would proceed with starting a series of posts called “Make It Pretty”, all about sharing ways of visualizing data that I think are attractive/effective/comprehensive. So with this inaugural MIP post, I will be covering how to plot 2-way interactions using ggplot2. 2-way interactions can come in one of three general forms, and I will be providing code for plotting each. This will be a pretty lengthy post (lots of code/explanation), so if you’re only interested in learning how to plot a particular form, just click the the one below. Oh, and each uses an APA format theme that I’ve shared before, but just click here to quickly flip to the code if you need it.

Link to resource: https://sakaluk.wordpress.com/2015/08/27/6-make-it-pretty-plotting-2-way-interactions-with-ggplot2/

Type of resources: Reading, R code

Education level(s): College / Upper Division (Undergraduates), Graduate / Professional

Primary user(s): Student, Teacher

Subject area(s): Life Science, Math & Statistics, Social Science

Language(s): English