Using a Venn Diagram

Clone a repo + start a new project

Go to the appex-07-[GITHUB USERNAME] repo, clone it, and start a new project in RStudio.

Data

We will be working with some data on 205 patients in Denmark with malignant melanoma (skin cancer). While the dataset Melanoma is provided through the package MASS, I have wrangled the data slightly to make it easier to understand for our purposes. We will work the wrangled data frame.

data("Melanoma")
Melanoma <- Melanoma %>%
  mutate(ulcer = ifelse(ulcer == 1, "Present", "Absent"),
         sex = ifelse(sex == 1, "Male", "Female"),
         status = case_when(status == 1 ~"Died (melanoma)",
                            status == 2 ~ "Alive",
                            T ~ "Died (other cause)"))

The following tables are representative of the data. You may knit the document to see the tables, or refer to the Application Exercise description on our course website.

Sex demographics
Female Male
Alive 91 43
Died (melanoma) 28 29
Died (other cause) 7 7
Ulcer distribution
Absent Present
Alive 92 42
Died (melanoma) 16 41
Died (other cause) 7 7

Answer the following questions using the data and tables provided above (knit this document first to see the tables!). If a probability cannot be calculated, indicate what additional information is needed in order to do so.

Exercise 1

What is the probability that a randomly selected patient in the study was assigned to died due to melanoma? Answer this question two ways: using the data frame and tidyverse code, and using the table.

Exercise 2

What is the probability that a randomly selected patient had an ulcer?

Exercise 3

What is the probability that a randomly selected patient in the trial died due to melanoma and had an ulcer?

Exercise 4

What is the probability that a randomly selected patient in the trial died due to melanoma or had an ulcer?

Exercise 5

What is the probability that a randomly selected patient in the trial is alive and had an ulcer and is female?

Submission

Once you are finished, submit this application exercise by knitting, committing, and pushing to GitHub!