5.7 Chapter summary
The package ggplot2
allows you to make flexible, publication-quality graphics. You define a mapping between your data frame and the attributes of the figure. This is known as an aesthetic. You then add geometric objects such as lines and points, and adjust the details using theme statements and other annotations. A particularly useful feature is your ability to facet the plot by the levels of a subsetting variable. Interaction models are models that include extra parameters to reflect the possibility that one of the predictor variables might modify the association between another predictor and the outcome. Significant interaction terms suggest that such effect modification does indeed occur, whereas non-significant ones suggest that the relationships between each of the predictors and the outcome are unaffected by the level of the other predictor. You use interaction models in many situations, such as when you have multiple IVs in an experiment, or when the relationship between the predictor and the outcome could be different in different participant subgroups.