8 Visualizing associations between two variables

Tutorial learning objectives

In this tutorial you will:

  • Learn how to visualize associations between two categorical variables using a contingency table
  • Learn how to visualize associations between two categorical variables graphically
  • Learn how to visualize associations between two numerical variables
  • Learn how to visualize associations between a numerical response variable and a categorical explanatory variable

Background

The type of graph that is most suitable for visualizing an association between two variables depends upon the type of data being visualized:

  • If both variables are categorical, we can visualize the association in a table called a contingency table, or we can visualize the association graphically using a grouped bar chart or a mosaic plot
  • If both variables are numeric, we visualize the association graphically using a scatterplot
  • If the response variable is numerical and the explanatory variable is categorical, we visualize the association graphically using a strip chart, boxplot, or variations on these
  • We do not discuss the scenario where the response variable is categorical and the explanatory variable is numerical

In this tutorial you’ll learn to construct and interpret each of these types of visualization. In later tutorials you’ll learn how to conduct statistical analyses of these associations.