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 Did more passengers survived?

No because the the height of the not survived on the chart is taller than the height of the did survive.

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

3rd class males was the largest group to not survive. On the chart third class males has the largest width corresponding to 1st and 2nd class. The males in third class is taller than the height of the females.

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

1st class females was the largest group to survive. The width of the 1st class females was wider than the width corresponding to 2nd and 3rd class. The height of the females is taller than the height of males in 1st class.

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

3rd class males did not survive more cases than expected compared to females. Dark blue box on graph.

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

2nd class males had survived with less cases than expected compared to 2nd class females. Dark red box indicates less 2nd class males survived than they should have.

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.

No because the height of no patients treated is higher. The largest group that didn’t receive treatment was the placebo group because it is wider than treated. The largest group that did receive treatment was the treated group because it is wider than the placebo treatment group. The people who received marked treatment had more cases than expected, the box was dark blue indicating it had more cases than expected. The marked placebo group had less expected cases than expected, the box was dark red indicating there where less than expected patients treated with placebo.

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