SSCC - Social Science Computing Cooperative Supporting Statistical Analysis for Research

3.3 Relationships between continuous and categorical variables

These exercises use the Mroz.csv data set that was imported in the prior section.

  1. Create a boxplot for lwg for women who attended college and women who did not.

    ggplot(mroz, aes(x = wc, y = lwg)) +
      geom_boxplot() +
      theme_bw()

  2. Create a boxplot for lwg for men who attended college and men who did not.

    ggplot(mroz, aes(x = hc, y = lwg)) +
      geom_boxplot() +
      theme_bw()