Data Study on NYC Leading Causes of Death
The skills the author demoed here can be learned through taking Data Science with Machine Learning bootcamp with NYC Data Science Academy.
Contributed by Joseph Mata. He currently in the NYC Data Science Academy Remote Bootcamp program taking place between September 18 to April 1st, 2018. This is based on his first project- Shiny(due on the 4th week of the program).

Being a yoga teacher, I believe that a person's behaviors can contribute to their health. However, data factors like ethnicity and sex cannot be chosen and impact the probability of death from a particular cause.
The project's goal was to determine what trends exist in the leading causes of death when looking through the lens of ethnicity and sex. I decided to focus on the four major ethnicities (White, Hispanic, Black, and Asian) in my hometown, New York City. I used data New York City Leading Causes of Death to conduct my research, which consisted of 708 observations and seven variables.
The Process
Using dplyr, I deleted any information about ethnicities that were not clearly defined by race ("Other Race/ Ethnicity", and "Not Stated/Unknown"). I then renamed the factors under Ethnicity and Sex to more straightforward terms. Afterward, the number of deaths and death rates were transformed from character strings to numeric values.
Data Analysis
In the seven years, 418,760 people died. Of the total, 49.3% were White, 26.5% were Black, 17.9% were Hispanic, and 6.29% were Asian. In regards to sex, 51.2% of deaths were women. Interestingly, more White women died than all Asian, Black, and Hispanic women combined.
I decided to use a box plot to determine the leading cause of death regardless of sex or race. The plot shows it is heart disease followed by cancer which makes up for 59.7% of deaths. Also, here we notice three outliers in heart disease, representing White female deaths from 2007-2009.
Diving deeper, the data suggest that,
on average more White men and women die from cancer and heart disease than any other race.
Globally we can see that the amount of deaths ascribed to heart disease has been declining while that of cancer relatively remained the same.
However, that is not the case when we look at specific races. For example, for Hispanics, heart disease does also declines from year to year. Yet, conversely, cancer increases besides having a dip in 2010.
There are many ways to analyze the data. To highlight global and categorically trends, I used R. Shiny, an interactive web application in which the user can create a live analysis. Here, one can input ethnicity, gender, and year to create a side-by-side comparison between two types of people.
Conclusion
Heart disease, followed by cancer, is the leading cause of death regardless of race, sex, or year. Though death by heart disease has steadily been decreasing in NYC in general, it is the exact opposite for some ethnicities. For example, from 2007-2009, most Asians, regardless of sex, have died from heart disease. However, in 2010, cancer took the lead and remained the number one cause of death for the next four years.