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,
More people died than survived
The largest group that didnt survive were the 3rd class male
The biggest group that survived were first class women
3rd class male didnt survive than expected - any Dark Blue box on the mosaic chart
1st class male has very little deaths - any dark red box
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.
More patients did not improve, The largest group is placebo, The largest group was Marked Treated, Marked Treated was the most surprising, Marked Placebo was the least surprising.
Hint: Use message, echo and results in the chunk options. Refer to the RMarkdown Reference Guide.