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
3rd class male is the largest group that did not survive
1st class females were the group that had the largest amount of people that survived. they had positive persons and the largest grouping.
The group that has more cases then expected givin independance is 3rd class males that did not survive.
The group that has less cases then expected given independance is 3rd class males that did 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= more people did not see improvement because of the hight of the box Q2= the largest group is placebo with no improvemnt because of the height of the box Q3= the largest group that saw no results are placebo that had no improvement Q4= the group that had more cases expected given independance was marked improvement that was treated Q5= the group with the least cases expected given independance was marked improvement that were placebo treatment.
Hint: Use message
, echo
and results
in the chunk options. Refer to the RMarkdown Reference Guide.