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,

Q1 Are more passengers survived?

No. More passangers did not surrvive than did surrvive. The total number of people who did not surrvive was much larger than the number of people that did surrvive.

Q2 Describe the largest group that didn’t survive. Discuss by class and gender.

The largest group that did not surrvive was 3rd class males. The 3rd class group had many more people not surrvive than the other two classes, and of the two genders there were many more males that did not surrvive.

Q3 Describe the largest group that did survive. Discuss by class and gender.

The largest group that surrvived was 1st class females. When we look at the people who surrvived, there were many more 1st class passangers that surrvived than the other two classes. Of those that surrvived in 1st class, there were more females than males that surrvived.

Q4 Describe one group that has more cases than expected given independence (by chance). Discuss by class and gender.

One group that has more cases than expected given independence is 3rd class males didn’t surrvive. It means that more 3rd class males died than was expected.

Q5 Describe one group that has less cases than expected given independence (by chance). Discuss by class and gender.

One group that has less cases than expected given independence is 3rd class males did surrvive. It means that less 3rd class males surrvived than was expected.

Q6 Create a mosaic plot for Arthritis in the same way as above.

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.

Q7 Repeat Q1-Q5.

  1. Less people saw marked improvment. It was lower than the amount of people who had no improvment.
  2. The largest group that had no improvment was the group that was treated with placebo.
  3. The largest group that had improvment was the group that was treated.
  4. One group that has more cases than expected givin independence is those that were treated and improved. They saw more people that were teated improve than they expected to happen.
  5. The largest group that had less cases than expected given independence was those who improved with placebo. It means that less people improved with placebo than expected.

Q8 Hide the messages, the code and its results on the webpage.

Hint: Use message, echo and results in the chunk options. Refer to the RMarkdown Reference Guide.

Q9 Display the title and your name correctly at the top of the webpage.

Q10 Use the correct slug.