The data set is from a case-control study of smoking and Alzheimer’s disease. The data set has two variables of main interest:

library(tidyverse)
## ── Attaching packages ────────────────────────────────────────── tidyverse 1.3.0 ──
## ✓ ggplot2 3.3.0     ✓ purrr   0.3.3
## ✓ tibble  2.1.3     ✓ dplyr   0.8.5
## ✓ tidyr   1.0.2     ✓ stringr 1.4.0
## ✓ readr   1.3.1     ✓ forcats 0.5.0
## ── Conflicts ───────────────────────────────────────────── tidyverse_conflicts() ──
## x dplyr::filter() masks stats::filter()
## x dplyr::lag()    masks stats::lag()
# Import data
data("alzheimer", package = "coin")

# create a table
tbl <- xtabs(~disease + smoking, alzheimer)
ftable(tbl)
##                 smoking None <10 10-20 >20
## disease                                   
## Alzheimer                126  15    30  27
## Other dementias           79   8    33  44
## Other diagnoses          104   5    47  20
# create a mosaic plot from the table
library(vcd)
## Loading required package: grid
mosaic(tbl, 
       shade = TRUE,
       legend = TRUE,
       labeling_args = list(set_varnames = c(disease = "")),
       set_labels = list(disease = c("Alzheimer", "Other\ndementias", "Other\ndiagnoses")))

Q1 Describe the largest group that has other dementias. Discuss it by number of cigarettes per day.

The largest would be the non smokers they smoked the least each day.

Q2 Describe one group that has more cases than expected given independence (by chance). Discuss it by number of cigarettes per day.

People who smoke more then 20 cigaretts per day.

Q3 Does smoking seem to matter in determining other dementias? Discuss your reason using the masaic chart above.

people who have dementias increase the number of smoking more often. ## Q4 Create correlation plot for RailTrail. Hint: The RailTrail data set is from the mosaicData package.

Q5 List all four variables that have negative correlation with the number of trail users (volume).

The variables that have negtive corrlation with the number of trail users are as seen in the chart, Spring, fall, cloudcover, and precipitation.

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.