Learning Goal: I’m working on a engineering project and need support to help me learn.
INSTRUCTIONS
I added a couple edits (it doesn’t change the assignment if you’ve started or completed it, they were just clarifications)
For this assignment, you will need to follow along with the 5th statistics lecture, practicing what is shown. This assignment is fairly straight-forward, because I just want you to try using mosaic plots and marginal tables to explore some classic categorical data.
For this assignment, I include two references. First, I provide a link to the first chapter of Michael Friendly’s book on categorical data analysis. You don’t need to read all of it, but skimming it might be good.
Part 1 of this assignment will involve installing and loading up the “vcd” package and extracting the data set that shows how hair and eye-color are related. You can follow along with the example beginning on page 7 of the Friendly chapter.
- Open the HairEyeColor data: data(“HairEyeColor”, package=”datasets”)str(HairEyeColor)print(HairEyeColor)
Paste the Output in your assignment.
2. Explore this dataset, and generate two mosaic plots: the first using “mosaicplot” with shading, and the second using “mosaic” and try color coding by one of the variables. Paste the output in your document.
3. Discuss the relative advantages and disadvantages of these two mosaic plots.
4. Discuss what the correspondence plot (second plot on page 8) is supposed to be telling us (note we have not covered this, just try to understand based on what the Friendly text says).
In part 2 I want you to load up the Berkeley admissions data (a classic data set from the 70s that may show gender disparities in admission).
# Load the dataset
data(UCBAdmissions)
# Help page
?UCBAdmissions
I want you to explore this with chi-square and mosaic plots, but you can also experiment with a few other plots, by following this tutorial from RStudio. Paste the results in your document and describe the results.