In this exercise you will learn to visualize the pairwise relationships between a set of quantitative variables. To this end, you will make your own note of 8.5 Mosaic plots from Data Visualization with R.
Mosaic charts can display the relationship between categorical variables using:
The Titanic data set came from https://osf.io/aupb4/.
In the graph below,
No, because there is a much larger death rate.
The largest group that didn’t survive were 3rd class males.
The largest group that did survive were 1st class females.
3rd class males that didn’t survive have more cases than expected.
3rd class males that did survive have less cases than expected.
Hint: The Arthritis data set is from the vcd package. Add an additional argument gp = shading_max in the mosaic function. This is because the residuals are too small to have color.
Q1. No, because there is a much larger group of people who haven’t improved.
Q2. The largest group that didn’t improve were people who used the placebo.
Q3. The largest group that did improve were people who were treated.
Q4. People who were treated and marked have more cases than expected.
Q5. People who used the placebo and marked have less cases than expected.
Hint: Use message, echo and results in the chunk options. Refer to the RMarkdown Reference Guide.