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 most passangers died on the titanic, mostly men in all classes.
The largest group that didn’t survive was the large dark blue rectangle as 3rd class males who didn’t survive on the titanic.
The largest group that survived was the dark blue medium size 1st class females.
The group that has more cases would be males in the 3rd class that didn’t survive and females in the first and second class that did survive
The group that has less cases would be males in the 3rd class and second class that survived and females in the first and second class that didnt survive
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. most people do not have any improvement in their treatments.
Q2. The largest group was the none imrpoved placebo treatment group
Q3.The largest group that has improved was the marked treated group
Q4. The more cases from a certain group would be the treated marked patients with the dark blue.
Q5. The less cases would be the marked placebo patiets with the darker red.
Hint: Use message, echo and results in the chunk options. Refer to the RMarkdown Reference Guide.