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. More passangers did not surrvive than did surrvive. The total number of people who did not surrvive was much larger than the number of people that did surrvive.
The largest group that did not surrvive was 3rd class males. The 3rd class group had many more people not surrvive than the other two classes, and of the two genders there were many more males that did not surrvive.
The largest group that surrvived was 1st class females. When we look at the people who surrvived, there were many more 1st class passangers that surrvived than the other two classes. Of those that surrvived in 1st class, there were more females than males that surrvived.
One group that has more cases than expected given independence is 3rd class males didn’t surrvive. It means that more 3rd class males died than was expected.
One group that has less cases than expected given independence is 3rd class males did surrvive. It means that less 3rd class males surrvived than was 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.
Hint: Use message, echo and results in the chunk options. Refer to the RMarkdown Reference Guide.