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 paasengers died because the chunck of those who did not survive is way bigger than those who did survive.

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

Males in third class.

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

Third class females was the largest group of survivors.

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

Third class males had many more cases of death’s than expected.

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

Less first class females perished than were expected by chance.

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.

In the graph below,

Q7 Repeat Q1-Q5.

  1. Less people saw improvement becuase the height of No improvement was highest.
  2. The largest group with no improvement were the people who took the placebo pill becuase the rectangle was larger than the treated one.
  3. The largest people who had improvement were the people who were treated with the real medication because it had a larger rectangle than the placebo people.
  4. More people were expected to have improvements when they were given the actual medication becuase they had a large rectangle for improvement.
  5. Less people were expected to have improvements when there were given the placebo because of the smaller improvement box of the 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 the correct slug.