U.S. Cancer Research & R Shiny Application

Posted on Aug 12, 2019


My career aspiration is to connect medical risk and treatment information from research facilities with individuals at risk and medical professionals. With that in mind, I wanted to build on my WebMD analysis with a more engaging form of research and insights for the medical community. I decided to extract general cancer diagnoses incidents in the United States from 1999 to 2015.  When I began researching, I was disappointed to find very few dynamic and visually friendly resources pertaining to demographics and regions for such a widespread condition. I realized there is a real need for a dynamic application that could be used by medical researchers, hospital management, and potential cancer patients to make informed decisions around this terrible disease and hopefully aid the resource and information allocation for the public and treatment organizations. That's why I decided to build one for this project.


I wanted to create an application that can easily identify trends associated with cancer diagnoses in the U.S. pertaining to demographic and geographic attributes. Are there patterns in Cancer diagnoses in gender, race, or age? Are there certain states that have proportionally more diagnoses than others? Is the rate at which cancer patients are being diagnosed increasing against the population growth of the U.S.? Cancer research centers (i.e. Susan G Komen Foundation, the CDC, etc.), hospitals, and people at risk for cancer should have information that will enable them to make important decisions about where to allocate resources, locate vital help or information, or understand their disposition of risk for getting cancer. Unfortunately federal programs make information available with only limited access or with low resolution and diversity of graphical representation, making it difficult for these stakeholders to readily find the information they seek. 

Cancer Statistics in the U.S.

Cancer is the second leading cause of death in the U.S. (to Heart Disease), with more than 1.7 million diagnoses in 2018 and over 600k deaths (Source: Cancer.gov). The Centers for Disease Control and Prevention (CDC) has collected data on incidents of cancer diagnoses in the U.S. uniformly since 1999. The United States Cancer Statistics (USCS) are the official federal registries for cancer incidents collected, maintained, and distributed by the CDC. Data is collected and shown herein as the variables listed below.  For more information on the CDC and USCS, or to inspect/extract additional information, click here.


  • State
  • Year
  • Age Group
  • Gender
  • Race
  • Cancer Diagnosis Count

*Note: Although there are more than 100 types of cancer known and available in the USCS, this application features only the generalized cancer counts. I intend to optimize this application to include all specific forms of cancer in future work.

R Shiny Dashboard

I used the Shiny Dashboard library in R to build my application. As the data could only be extracted from a low-capacity online reporting tool, I first had to extract numerous .txt files; clean, parse, and convert types in the raw data; and merge into one uniform, cleaned dataset in .csv format. I then read this data into RStudio, began exploring and visualizing in aggregate, and lastly built dynamic and filterable tabs in a ui.R, server.R, and global.R to showcase many spatial and demographic distributions of cancer diagnoses. I used Google’s gVis library for geographical mapping, ggplot2 for gender, race, age, and gender distributions, and the VCD library for a mosaic plot across most features. The application design is meant to be highly interactive with as many filterable capabilities as possible; again, with the goal of serving a wealth of vital information to hospitals and research centers for resource allocation. To see the app for yourself, click here!

Analysis & Insights

- QUESTION 1: At what age are people most likely to be diagnosed with Cancer?

- ANSWER 1: Most people are diagnosed with cancer between ages 50 and 85. The peak age group for diagnosis is age 65.

- QUESTION 2: Are there any races that are diagnosed more than others?

- ANSWER 2: Roughly 90% of people in the U.S. diagnosed with Cancer are caucasian, followed by roughly 8% African-American. This is compared to the roughly 77% population of caucasians and 13% of African-Americans living in the U.S.

- QUESTION 3: Are cancer diagnoses increasing year-over-year?

- ANSWER 3: Diagnoses of cancer are rising by roughly 2% each year from 1999 to 2015.  The average annual increase in population in the same period is 0.9%.

- QUESTION 4: Is one gender diagnosed more than the other? Any difference in ages most commonly diagnosed between genders?

- ANSWER 4: There appears to be no difference in diagnosis by gender, nor by distribution of age diagnosed against gender.

- QUESTION 5: Which States have more/less cancer diagnoses?

- ANSWER 5: The amount of cancer diagnoses per state generally tends to follow the amount of population living in that state.  The one notable exception is Texas where there are proportionately fewer diagnoses than population compared to other states.

- QUESTION 6: Are there differences in the age different races are diagnosed?

- ANSWER 6: Caucasian and African-American, while roughly comprising of 98% of diagnosed people in the U.S., tend to be diagnosed at an older age (median age 55) as compared to Asian/Pacific (median age 35), Other (median age 35), and Native Americans (median age 25).

Future Work

  • Optimize Shiny App by reducing duplication in code and consolidating to global.R.
  • Create more interaction between Home page, allowing users to link directly to visualizations from the main page outside of the left menu.
  • Extract statistical inference and statistical hypothesis testing to the Race and Age demographics to validate the significance in Race and Age groups observed in the Analysis section.
  • Expand the scope of the application to include all specific types of Cancer, other conditions and diseases publicly available (via CDC), and all territories globally.
  • Adjust axis labels on Mosaic chart for less clutter. Test accuracy of groupings.  Among findings I'd like to check is that the 90% caucasian from other analysis does not appear consistent with this chart.
  • Create Reactive Functions that disable filters without underlying data associated to appear.
  • Research and validate accuracy of source (CDC) Data. Coordinate collaborations with CDC to add a visual layer to their medical condition records.

Thank you for reading! If you'd like to see this project on my github, feel free to have a look here. To see the actual R Shiny app, click here.

About Author


Eric Meyers

Eric is a data scientist with 7+ years in advanced analytics and data management experience across the music, luxury automotive, government, cosmetics, entertainment, and media fields. Most recently, Eric was a Director in Decision Sciences at Universal McCann....
View all posts by Eric Meyers >

Related Articles

Leave a Comment

mksorb.com August 5, 2020
mksorb.com [...]always a huge fan of linking to bloggers that I really like but don’t get a great deal of link really like from[...]
mksorb.com July 30, 2020
mksorb.com [...]check below, are some absolutely unrelated web sites to ours, nevertheless, they are most trustworthy sources that we use[...]
cbd oil for cats July 9, 2020
cbd oil for cats [...]The information talked about inside the write-up are a number of the top accessible [...]

View Posts by Categories

Our Recent Popular Posts

View Posts by Tags

2019 airbnb Alex Baransky alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus API Application artist aws beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep Bundles California Cancer Research capstone Career Career Day citibike clustering Coding Course Demo Course Report D3.js data Data Analyst data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization Deep Learning Demo Day Discount dplyr employer networking feature engineering Finance Financial Data Science Flask gbm Get Hired ggplot2 googleVis Hadoop higgs boson Hiring hiring partner events Hiring Partners Industry Experts Instructor Blog Instructor Interview Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter lasso regression Lead Data Scienctist Lead Data Scientist leaflet linear regression Logistic Regression machine learning Maps matplotlib Medical Research Meet the team meetup Networking neural network Neural networks New Courses nlp NYC NYC Data Science nyc data science academy NYC Open Data NYCDSA NYCDSA Alumni Online Online Bootcamp Open Data painter pandas Part-time Portfolio Development prediction Prework Programming PwC python python machine learning python scrapy python web scraping python webscraping Python Workshop R R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn Selenium sentiment analysis Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau team TensorFlow Testimonial tf-idf Top Data Science Bootcamp twitter visualization web scraping Weekend Course What to expect word cloud word2vec XGBoost yelp