Question
R coding In class, we created a mosaic plot of smoking status for each level of exercise in the `survey` dataset in the `MASS` package.
R coding
In class, we created a mosaic plot of smoking status for each level of exercise in the `survey` dataset in the `MASS` package. The bars and the categories for each bar were not in logical order, but rather alphabetical order. Recreate the mosaic plot putting the levels of smoking status and exercise in a logical order. In order to do this, re-code the values of the variables with numbers and then make the mosaic plot again with the re-coded variables. You can leave the mosaic plot labeled with numbers, but explain in text below your plot what the number codings represent.
First, we will remove row 70 of the dataset since that observation has a missing value for smoking status:
```{r} library(MASS) surveydata = survey[-70,]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started