OTP Long Island Rail Road On-Time Performance Shiny

Posted on Feb 3, 2019


As a Long Island Rail Road (LIRR) commuter for many years, I've experienced frustrating delays, cancellations and terminations. I wanted to investigate if my branch, Port Jefferson, was more prone to performance issues than other branches. I further set out to discover if On-Time Performance (OTP) is associated with time of year and how OTP has developed over the past decade. Since other commuters may have similar interests, I've created an interactive web application to visualize performance data.


The dataset was gathered from data.ny.gov and comes from the MTA’s Performance Dashboard. The data is used to increase transparency at the MTA. Key Performance Indicators (KPI) are used to track performance in areas such as OTP. OTP is defined as the percent of commuter trains that arrive at their destinations within 5 minutes and 59 seconds of their scheduled arrival time.

Application Features & Results

In the Yearly OTP By Branch tab, a user can select any year over the past decade to visualize how a branch performed in a given year and compare to other branches. Alternatively, a user can select the Overall OTP By Branch tab to visualize the average performance of all branches over the past decade.

From the Overall OTP By Branch comparison chart, the Port Jefferson branch is the lowest performer of the past decade with a 89.97% OTP. This means that more than one in ten trains are either delayed, cancelled or terminated on average during the given time period.

To investigate if OTP is associated with time of year or to visualize how OTP has developed over the past ten years, a user can select a branch from a drop down menu and the corresponding plots will update accordingly giving a trend-line.

According to the data, the Port Jefferson branch represented by the blue trend-line on average performs best during April and worst during November. The best performing year of the past decade was 2009 and the worst was 2015. Looking at the overall performance of the LIRR over the past decade represented by the red trend-line, a distinct downward trend is observed indicating that performance is decreasing over time. Since 2009, the average overall OTP has decreased by nearly five percent. With nearly 250,000 scheduled trains per year, that is an annual increase of nearly 12,500 trains delayed, cancelled or terminated.

Additional Insights

After visualizing branch OTP over the past decade, the worst performing branches appeared to have the longest track distances and largest number of stations. Conversely, the best performing branches appeared to be have the shortest track distances and least number of stations. It seemed reasonable to hypothesize that as track distance increases and/or number of stations increase, that the opportunity to accumulate delays would also be greater. To visualize this relationship, I plotted OTP as a function of track distance and number of stations under the Performance Association tab. According to the data, it appears branches with less track distance typically perform better than those with more track distance. Similarly, branches with fewer stations typically perform better than those with a greater number of stations.


Future Work

As a commuter who typically takes the same trains each day, I am more interested to know how my particular train performs in comparison to the rest of the branch and LIRR. The dataset available from nyc.gov did not provide enough information to illustrate such granularity. However, MTA releases information each month on their website illustrating all delayed and cancelled trains with individual train tags. I intend to web-scrape this data and add a tab where a user can select their particular train to obtain OTP statistics.

The LIRR OTP application can be accessed here: https://joseph-c-fritch.shinyapps.io/Shiny_Project/


About Author

Joseph C. Fritch

Data Scientist and Control Systems Engineer with 5 years experience in the energy analysis and building automation space. Interests include machine learning and its applications in controlling dynamic systems.
View all posts by Joseph C. Fritch >

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