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 the majority of people died
The largest group that didnt survive were 3rd class males
The largest group that survived were 1st class females
More 3rd class male passengers would have died if class didnt matter
Fewer 3rd class males survived than expected by chance, if gender and class didnt matter more 3rd class males should have survived.
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- Majority did not show any signs of improvment Q2- The placebo group was the largest group that didnt show improvment Q3- The group that showed the most improvement was the treated group Q4- More people showed improvment that got treated than expected Q5- Less people showed improvment from the placebo group than expected
Hint: Use message, echo and results in the chunk options. Refer to the RMarkdown Reference Guide.