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.
At the console, run the commands library(mosaic) and library(tidyverse).
Then you can run the commands ?CPS85 and glimpse(CPS85) to get a sense for what this dataset contains.
Next, start exploring the dataset using plots, tables, and other numeric summaries. You should use the mplot(CPS85) command.
This will display a SETTINGS wheel. If you click it you should see a menu.
Please select ggplot2 as your graphics system.
Begin by selecting variables for X and Y axes.
Next you can overlay plots (using color with a categorical variable) and stratifying (using facets and a different categorical variables), and adding a model (e.g., line or smoother).
When you click Show Expression the code to generate that figure is displayed in the console.
Add these commands to this Quarto file and render it. Tell a short story (in writing) about it.
When you are ready to share, Publish your results to RPubs (see board for login information).
The scribe should download the completed Quarto file and share it by email with the other group members.
OUR FAVORITE PLOT
# put the code for your plot hereggplot(data = CPS85, aes(x = age, y = wage)) +geom_point() +aes(colour = educ) +facet_wrap(~married, ncol =4) +stat_smooth(method = lm) +theme(legend.position ="right") +labs(title ="")
`geom_smooth()` using formula = 'y ~ x'
Warning: The following aesthetics were dropped during statistical transformation:
colour.
ℹ This can happen when ggplot fails to infer the correct grouping structure in
the data.
ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
variable into a factor?
The following aesthetics were dropped during statistical transformation:
colour.
ℹ This can happen when ggplot fails to infer the correct grouping structure in
the data.
ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
variable into a factor?
(Include the description for your plot here.)
As age increases, wage increases slightly. Married status leads to people living longer than single people.