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 passengers did not survive than those who did.
The largest group whio did not survive was 3rd class males.
The largest group that did survive was 1st class females.
3rd class males had more passengers not survive than expected.
3rd class males had less passengers survive 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.
##1 Are more people Improved?
No, more people were not improved.
##2 Describe the largest group that didn’t improve.
The largest group that didnt improve were the people with a placebo treatment.
##3 Describe the largest group that did improve.
The largest group that did improve were people who were treated.
##4 Describe one group that has more cases than expected given independence (by chance).
People who were marked treated had more cases than expected.
##5 Describe one group that has less cases than expected given independence (by chance).
People who were marked treated while given a placebo had less cases than expected.
Hint: Use message, echo and results in the chunk options. Refer to the RMarkdown Reference Guide.