NYC Data Science Academy| Blog
Bootcamps
Lifetime Job Support Available Financing Available
Bootcamps
Data Science with Machine Learning Flagship ๐Ÿ† Data Analytics Bootcamp Artificial Intelligence Bootcamp New Release ๐ŸŽ‰
Free Lesson
Intro to Data Science New Release ๐ŸŽ‰
Find Inspiration
Find Alumni with Similar Background
Job Outlook
Occupational Outlook Graduate Outcomes Must See ๐Ÿ”ฅ
Alumni
Success Stories Testimonials Alumni Directory Alumni Exclusive Study Program
Courses
View Bundled Courses
Financing Available
Bootcamp Prep Popular ๐Ÿ”ฅ Data Science Mastery Data Science Launchpad with Python View AI Courses Generative AI for Everyone New ๐ŸŽ‰ Generative AI for Finance New ๐ŸŽ‰ Generative AI for Marketing New ๐ŸŽ‰
Bundle Up
Learn More and Save More
Combination of data science courses.
View Data Science Courses
Beginner
Introductory Python
Intermediate
Data Science Python: Data Analysis and Visualization Popular ๐Ÿ”ฅ Data Science R: Data Analysis and Visualization
Advanced
Data Science Python: Machine Learning Popular ๐Ÿ”ฅ Data Science R: Machine Learning Designing and Implementing Production MLOps New ๐ŸŽ‰ Natural Language Processing for Production (NLP) New ๐ŸŽ‰
Find Inspiration
Get Course Recommendation Must Try ๐Ÿ’Ž An Ultimate Guide to Become a Data Scientist
For Companies
For Companies
Corporate Offerings Hiring Partners Candidate Portfolio Hire Our Graduates
Students Work
Students Work
All Posts Capstone Data Visualization Machine Learning Python Projects R Projects
Tutorials
About
About
About Us Accreditation Contact Us Join Us FAQ Webinars Subscription An Ultimate Guide to
Become a Data Scientist
    Login
NYC Data Science Acedemy
Bootcamps
Courses
Students Work
About
Bootcamps
Bootcamps
Data Science with Machine Learning Flagship
Data Analytics Bootcamp
Artificial Intelligence Bootcamp New Release ๐ŸŽ‰
Free Lessons
Intro to Data Science New Release ๐ŸŽ‰
Find Inspiration
Find Alumni with Similar Background
Job Outlook
Occupational Outlook
Graduate Outcomes Must See ๐Ÿ”ฅ
Alumni
Success Stories
Testimonials
Alumni Directory
Alumni Exclusive Study Program
Courses
Bundles
financing available
View All Bundles
Bootcamp Prep
Data Science Mastery
Data Science Launchpad with Python NEW!
View AI Courses
Generative AI for Everyone
Generative AI for Finance
Generative AI for Marketing
View Data Science Courses
View All Professional Development Courses
Beginner
Introductory Python
Intermediate
Python: Data Analysis and Visualization
R: Data Analysis and Visualization
Advanced
Python: Machine Learning
R: Machine Learning
Designing and Implementing Production MLOps
Natural Language Processing for Production (NLP)
For Companies
Corporate Offerings
Hiring Partners
Candidate Portfolio
Hire Our Graduates
Students Work
All Posts
Capstone
Data Visualization
Machine Learning
Python Projects
R Projects
About
Accreditation
About Us
Contact Us
Join Us
FAQ
Webinars
Subscription
An Ultimate Guide to Become a Data Scientist
Tutorials
Data Analytics
  • Learn Pandas
  • Learn NumPy
  • Learn SciPy
  • Learn Matplotlib
Machine Learning
  • Boosting
  • Random Forest
  • Linear Regression
  • Decision Tree
  • PCA
Interview by Companies
  • JPMC
  • Google
  • Facebook
Artificial Intelligence
  • Learn Generative AI
  • Learn ChatGPT-3.5
  • Learn ChatGPT-4
  • Learn Google Bard
Coding
  • Learn Python
  • Learn SQL
  • Learn MySQL
  • Learn NoSQL
  • Learn PySpark
  • Learn PyTorch
Interview Questions
  • Python Hard
  • R Easy
  • R Hard
  • SQL Easy
  • SQL Hard
  • Python Easy
Data Science Blog > R > Data Visualization on Air Quality

Data Visualization on Air Quality

Bin Lin
Posted on Feb 16, 2016
The skills the author demoed here can be learned through taking Data Science with Machine Learning bootcamp with NYC Data Science Academy.
Contributed by Bin Lin. Bin is currently in the NYC Data Science Academy 12 week full time Data Science Bootcamp program taking place between January 11th to April 1st, 2016. This post is based on his first class project - R Visiualization (due on the 6th week of the program).

Introduction:

Data shows air pollution is a leading cause of death across the globe, and contributes to stroke, heart disease, lung cancer, and other respiratory illness. The goal of this project is to explore the air quality of the New York tri-state area.

Data:

The datasets used in this project cover the daily data between year 1980 โ€“ 2015 for New York tri-state area. Air quality data are  collected at outdoor monitors across the United States and can be download from EPA (Environment Protection Agency) web site https://www3.epa.gov/airdata/ad_data.html.

The AQI is an index for reporting daily air quality. It tells you how clean or polluted your air is, and what associated health effects might be a concern for you. The higher the AQI value, the greater the level of air pollution and the greater the health concern. Smaller AQI means better air quality.

EPA calculates the AQI for five major air pollutants regulated by the Clean Air Act:

  • Ozone
  • PM (Particle pollution or particulate matter)
  • CO (carbon monoxide)
  • SO2 (sulfur dioxide)
  • NO2 (nitrogen dioxide)

Therefore, in our data and visualiztion analysis, we will only be seeing the AQI of these pollutants. See Figure 1 for example of the data. And the Overall AQI is the maximum AQI among these pollutants (Overall AQI = max(Ozone, PM10, PM25, CO, SO2, NO2) ). Note that PM2.5 are not being monitored until late 1990's. Therefore there will be some missingness for PM25 variable.

Figure 1: Example of data

air_quality_data

EPA has divided AQI into six categories, which represent the level of air quality conditions. See Figure 2 below for the AQI ranges and corresponding air quality conditions.

aqi_and_air_quality_condition

Data Visualization Analysis:

At First Glance:

First question, from 1980 to now, is air quality in New York tri-state area getting better  or worse? Let's take a quick visual overview at the air quality over time. See below Figure 3

  • Figure 3 is the scatterplot of AQI on dates. There is also a blue line indicating the mean of the over all AQI.
  • AQI has been decreasing which means  air quality is getting better
  • Before 1990's, averaged AQI had been decreasing, however air quality still frequently fell into the "Unhealthy for Sensitive Groups" condition, and sometimes even the "Unhealthy" or "Very Unhealthy" condition.
  • Since 1990's, AQI has been continuously decreasing,  air quality mostly has been mostly "Moderate" or "Good" condition.
  • Thanks for the Clean Air Act (1963), which helps reduce the air pollution.

Figure 3: AQI on Date in New York Tri-state Area

diagram1_overview

Main Pollutants:

Now, let's look at what are pollutants as the main pollutants over time. Recall that the pollutant with highest API will be selected as  main pollutant and its API will be used as the over all AQI.

  • Figure 4 is a stack bar plot that shows the yearly summary of main pollutants.
  • Figure 5 is a sactterpot that shows the main pollutant on each date.
  • Both convey tat CO and SO2 had showed up quite frequently but the frequency as main pollutant has been decreasing. Ozone and PM2.5 with high AQI show up quite frequently in the recent years.
  • Ground-level ozone and airborne particles are the two pollutants that pose the greatest threat to human health in the United States.

Figure 4: Percentage of Each Pollutant as Main Pollutant on Each Year

diagram3_major_pollutant_index

Figure 5: Percentage of Each Pollutant as Main Pollutant on Date

diagram3_each_pollutant_index_point

AQI of Each Pollutant:

If by look at just the over all AQI and the corresponding main pollutant, it can not be told what the  AQI of other pollutants are and how they impact our health.

  • Figure 6 is a smooth line graph that plots the mean AQI of each pollutant over time.
  • Figure 7 is a connected line graph that plots AQI of each pollutant on each date.
  • Both convey that while AQIs of CO, SO2, and PM10 have been continuously dropping to low level, Ozone, NO2, and PM2.5 haven't dropped that much. Especially from Figure 7, these stubborn bad ones reach to high AQI that is over 100 or even 200 (meaning unhealthy air quality condition).
  • Main reason of the high AQI of Ozone, NO2, and PM2.5 are related to high number of factories, high number of vehicles, and other source of pollution that are still not under well controlled.

Figure 6: Mean AQI of each pollutant over time

diagram3_each_pollutant_index_smooth

Figure 7: AQI of each pollutant on each date

diagram3_each_pollutant_index

Source 8: Sources of Pollution

sources-of-pollution-800

 Monthly View of Air Quality:

Here is another question? In which months the air quality conditions are good (or bad) in New York tri-state area? Figure 9 tells us that in general, air quality conditions are bad during the summers. Especially from June to August, the averaged air quality is in the "Unhealthy for Sensitive Groups" level. This probably is because more people are driving during summer and more Air Conditioner are turned on. So, go to a trip away from home during summer to enjoy better air somewhere else!

Figure 9: Mean Over All AQI Group by Month

diagram4_aqi_mean_by_month

Air Quality of Manhattan after September 11 2001:

As I have been wondering the air quality of Manhattan on and after September 11, 2001, I have download the AQI data for Manhattan during that time of period to explore.

  • Figure 10 is the scatter point and line graph that plots the daily AQI from September to November 2001.
  • Figure 10 shows that over all AQI was under 50 or 100 most of the time, which indicates that air quality was still  "Moderate" or "Good" level. There was NO drastic change based on the AQI.
  • As AQI tells you the air quality based on the monitored pollutants only, it doesn't tell you when the air contains other bad matters. On and after September 11 2001, there were high toxicity of the air, and Word Trade Center dust included asbestos and disturbingly high PH levels. Many people have suffered health effects because of that.

Figure 10: AQI of Manhattan around September 11 2001

diagram5_9_11_2001_aqi

Summary:

As air quality has been improved and there are still pollutants (Ozone, NO2, and PM2.5) retain at high AQI. Effort should continuously be made to reduce them. How can we make a difference? Drive less, use less electricity, don't burn wood or trash, support measures in your community that can cut air pollution, etc.

Also air quality continues to worsen in cities across the world, especially in low-income countries and developing countries.  Cooperation should be setup among countries in combating air pollution.

About Author

Bin Lin

Bin is a former professional in software development with now positioned for Data Scientist role. With both strong programming skill and newly acquired machine learning skills, Bin is able to apply scientific thinking to predict or uncover insights...
View all posts by Bin Lin >

Related Articles

Data Analysis
Car Sales Report R Shiny App
Machine Learning
Ames House Prices Predictions
R Shiny
Forecasting NY State Tax Credits: R Shiny App for Businesses
R
R Shiny Shows Decline in Even Strongest Democracies
Data Visualization
Python Shows Factors Influencing University Retention Rates

Leave a Comment

Cancel reply

You must be logged in to post a comment.

Google August 28, 2021
Google Every once inside a even though we select blogs that we read. Listed below are the newest web sites that we pick.
Google January 2, 2021
Google Every once inside a although we pick out blogs that we study. Listed below are the newest web pages that we pick out.
Google December 25, 2020
Google Here are some links to sites that we link to because we assume they are really worth visiting.
CBD Oil For Dogs December 15, 2020
CBD Oil For Dogs [...]the time to study or go to the content or web sites we've linked to beneath the[...]
mksorb.com November 14, 2020
mksorb.com [...]below youย’ll uncover the link to some web-sites that we think you ought to visit[...]
Google September 4, 2020
Google That may be the finish of this article. Right here you will come across some websites that we consider youย’ll enjoy, just click the hyperlinks.
Google September 3, 2020
Google Wonderful story, reckoned we could combine several unrelated data, nevertheless definitely really worth taking a appear, whoa did one find out about Mid East has got much more problerms too.
Windows August 28, 2020
Windows [...]Here is a good Blog You might Uncover Intriguing that we Encourage You[...]
OnHax Me August 19, 2020
OnHax Me [...]here are some links to internet sites that we link to mainly because we consider they are really worth visiting[...]
mksorb.com August 5, 2020
mksorb.com [...]we prefer to honor quite a few other world-wide-web web pages around the web, even when they arenย’t linked to us, by linking to them. Beneath are some webpages worth checking out[...]
mksorb.com July 30, 2020
mksorb.com [...]please pay a visit to the internet sites we comply with, including this one, as it represents our picks from the web[...]
cbd for cats July 9, 2020
cbd for cats [...]Here are several of the web pages we advocate for our visitors[...]

View Posts by Categories

All Posts 2399 posts
AI 7 posts
AI Agent 2 posts
AI-based hotel recommendation 1 posts
AIForGood 1 posts
Alumni 60 posts
Animated Maps 1 posts
APIs 41 posts
Artificial Intelligence 2 posts
Artificial Intelligence 2 posts
AWS 13 posts
Banking 1 posts
Big Data 50 posts
Branch Analysis 1 posts
Capstone 206 posts
Career Education 7 posts
CLIP 1 posts
Community 72 posts
Congestion Zone 1 posts
Content Recommendation 1 posts
Cosine SImilarity 1 posts
Data Analysis 5 posts
Data Engineering 1 posts
Data Engineering 3 posts
Data Science 7 posts
Data Science News and Sharing 73 posts
Data Visualization 324 posts
Events 5 posts
Featured 37 posts
Function calling 1 posts
FutureTech 1 posts
Generative AI 5 posts
Hadoop 13 posts
Image Classification 1 posts
Innovation 2 posts
Kmeans Cluster 1 posts
LLM 6 posts
Machine Learning 364 posts
Marketing 1 posts
Meetup 144 posts
MLOPs 1 posts
Model Deployment 1 posts
Nagamas69 1 posts
NLP 1 posts
OpenAI 5 posts
OpenNYC Data 1 posts
pySpark 1 posts
Python 16 posts
Python 458 posts
Python data analysis 4 posts
Python Shiny 2 posts
R 404 posts
R Data Analysis 1 posts
R Shiny 560 posts
R Visualization 445 posts
RAG 1 posts
RoBERTa 1 posts
semantic rearch 2 posts
Spark 17 posts
SQL 1 posts
Streamlit 2 posts
Student Works 1687 posts
Tableau 12 posts
TensorFlow 3 posts
Traffic 1 posts
User Preference Modeling 1 posts
Vector database 2 posts
Web Scraping 483 posts
wukong138 1 posts

Our Recent Popular Posts

AI 4 AI: ChatGPT Unifies My Blog Posts
by Vinod Chugani
Dec 18, 2022
Meet Your Machine Learning Mentors: Kyle Gallatin
by Vivian Zhang
Nov 4, 2020
NICU Admissions and CCHD: Predicting Based on Data Analysis
by Paul Lee, Aron Berke, Bee Kim, Bettina Meier and Ira Villar
Jan 7, 2020

View Posts by Tags

#python #trainwithnycdsa 2019 2020 Revenue 3-points agriculture air quality airbnb airline alcohol Alex Baransky algorithm alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus ames dataset ames housing dataset apartment rent API Application artist aws bank loans 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 boston safety Bundles cake recipe California Cancer Research capstone car price Career Career Day ChatGPT citibike classic cars classpass clustering Coding Course Demo Course Report covid 19 credit credit card crime frequency crops D3.js data data analysis Data Analyst data analytics data for tripadvisor reviews data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization database Deep Learning Demo Day Discount disney dplyr drug data e-commerce economy employee employee burnout employer networking environment feature engineering Finance Financial Data Science fitness studio Flask flight delay football gbm Get Hired ggplot2 googleVis H20 Hadoop hallmark holiday movie happiness healthcare frauds higgs boson Hiring hiring partner events Hiring Partners hotels housing housing data housing predictions housing price hy-vee Income industry Industry Experts Injuries Instructor Blog Instructor Interview insurance italki Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter las vegas airport lasso regression Lead Data Scienctist Lead Data Scientist leaflet league linear regression Logistic Regression machine learning Maps market matplotlib Medical Research Meet the team meetup methal health miami beach movie music Napoli NBA netflix Networking neural network Neural networks New Courses NHL nlp NYC NYC Data Science nyc data science academy NYC Open Data nyc property NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time performance phoenix pollutants Portfolio Development precision measurement prediction Prework Programming public safety PwC python Python Data Analysis python machine learning python scrapy python web scraping python webscraping Python Workshop R R Data Analysis 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 seafood type Selenium sentiment analysis sentiment classification Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau teachers team team performance TensorFlow Testimonial tf-idf Top Data Science Bootcamp Top manufacturing companies Transfers tweets twitter videos visualization wallstreet wallstreetbets web scraping Weekend Course What to expect whiskey whiskeyadvocate wildfire word cloud word2vec XGBoost yelp youtube trending ZORI

NYC Data Science Academy

NYC Data Science Academy teaches data science, trains companies and their employees to better profit from data, excels at big data project consulting, and connects trained Data Scientists to our industry.

NYC Data Science Academy is licensed by New York State Education Department.

Get detailed curriculum information about our
amazing bootcamp!

Please enter a valid email address
Sign up completed. Thank you!

Offerings

  • HOME
  • DATA SCIENCE BOOTCAMP
  • ONLINE DATA SCIENCE BOOTCAMP
  • Professional Development Courses
  • CORPORATE OFFERINGS
  • HIRING PARTNERS
  • About

  • About Us
  • Alumni
  • Blog
  • FAQ
  • Contact Us
  • Refund Policy
  • Join Us
  • SOCIAL MEDIA

    ยฉ 2025 NYC Data Science Academy
    All rights reserved. | Site Map
    Privacy Policy | Terms of Service
    Bootcamp Application