Electricity Generation Comparisons: The United States Energy

Posted on May 11, 2020
The skills I demoed here can be learned through taking Data Science with Machine Learning bootcamp with NYC Data Science Academy.


The United States is the second largest electricity producer in the world, and has made great strides in improving its electricity generation profile over the last 30 years with natural gas accounting for around 40% of the generation sources and renewables at around 10%, and coal at 23%. 

This compares favorably to the profile 30 years ago in which the main generation source was coal at more than 50%, natural gas at 12%, and less than 2% from renewable sources.  Nuclear has remained relatively constant over the period at roughly 20%.  This project looks at how the trend is reflected among the individual states. 



The datasets were obtained from the U.S. Energy Information Administration website (www.eia.gov), which maintains various energy related news and information.  The datasets were clean with no missing values and consist of annual generation figures from various sources in megawatt hours (MWh) with the year and state in respective columns.  As the final generation figures for a given year are reported in the follow year, the 2019 figures were preliminary.  Nevertheless, no material changes were expected.  The 2019 figures were combined into the 1990-2018 set for the project.     



The app allows the user to select two years between 1990 and 2019 and two states for comparing electricity generation profiles.  The user has the flexibility to compare a state, or two different states, at two different times; or compare two different state for a given year.  The output graphs show the generation source composition at absolute and relative levels.      


The change in the generation profile is most prominent in some of the largest energy producing states, such as California, Texas, Florida, New York, marked by shift to natural gas to at least 40% complemented by rise in renewable energy, at the expense of coal. 


An interesting development can be seen for the state of Hawaii.  In particular, though the state continued to rely heavily on petroleum as the main source of electricity (90% in 1990 vs. 70% in 2019), its usage of coal increased to about 13% in 2019 (compared to less than 1% in 1990).  The likely reason may be due to the fact that Hawaii has no natural resources and relies on importing its energy sources from the upper 48 states.  And as other states use less coal, Hawaii became a price taker as the cost of coal declined.        


Another notable point can be seen in some smaller states, such as Maine and Vermont, which experienced declining generation capacity over the past 30 years driven by shifting demographics as the younger population moved out of the states for better employment prospects elsewhere.  The changing demographics picture is significant as it is a factor in the state public commissions’ decision in approving utility rates and return allowance for public utilities.  Nevertheless, the generation profile for the two states improved with greater emphasis on renewable sources.           



The declining usage of coal over the years as a generation source at the national level is driven by the changes undertaken at the state level.  The decrease in coal is replaced by increased utilization of natural gas and renewables as the issue of climate change comes to the discussion foreground.  What is interesting about the U.S. renewables space is that it is driven mostly by the state mandates and initiatives as the federal tax credits are expiring. 

Given the current form of the project, I would like to revisit it and add in summary statistics that would provide the user with further insight into the data.  Overall, it was an invaluable experience in learning about working with the R Shiny app.


About Author

Peter Liu

Peter Liu has more than 14 years of experience in corporate credit risk management and held various financial analytics positions. He has an MBA and a BA in mathematics.
View all posts by Peter Liu >

Leave a Comment

No comments found.

View Posts by Categories

Our Recent Popular Posts

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 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 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 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