ggplot(data = CPS85, aes(x = educ, y = wage)) + geom_point() + aes(colour = sex) + facet_wrap(~married, ncol = 4) + stat_smooth(method = lm) + theme(legend.position = "right") + labs(title = "")`geom_smooth()` using formula = 'y ~ x'
li— title: “STAT 135 (Intro to Stats via Modeling): CPS data” author: “XX Anysa, Kiara, Luciano, Marin” date: “2026-01-29” date-format: iso format: html editor: source
In groups of three, your task is to generate a multivariate visualization of the CPS85 dataset that tells a story. We are looking for three or four variables being displayed in a scatterplot. The Current Population Survey is conducted by the US Census Bureau and the US Bureau of Labor Statistics.
The person whose birthday comes up next will be the leader. The person whose birthday comes up next after that will be the scribe. The third person will be the expert on the CPS85 data.
The data are available within the mosaicData package.
library(mosaic) and library(tidyverse).?CPS85 and glimpse(CPS85) to get a sense for what this dataset contains.mplot(CPS85) command.ggplot2 as your graphics system.Show Expression the code to generate that figure is displayed in the console.Publish your results to RPubs (see board for login information).ggplot(data = CPS85, aes(x = educ, y = wage)) + geom_point() + aes(colour = sex) + facet_wrap(~married, ncol = 4) + stat_smooth(method = lm) + theme(legend.position = "right") + labs(title = "")`geom_smooth()` using formula = 'y ~ x'
(There is a positve but weak correlation between wage and education. From the data we can infer that regardless of marraige status and gender, the more education a person has, the higher their wage is. For married people, we can infer that men constantly earn more than women. For single people, at a level of less education, men earn more than women, the mroe education single people obtain, females eventually earn more than men.