<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="https://www.r-bloggers.com/hubway-bike-share-ridership-patterns/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://blog.nycdatascience.com/student-works/r-visualization/hubway-bike-share-ridership-patterns/"> R – NYC Data Science Academy Blog</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p><em>Contributed by <a target="_blank" rel="nofollow" href="http://blog.nycdatascience.com/author/tkassel/">Thomas Kassel</a>. He is currently enrolled in the NYC Data Science Academy 17-week remote bootcamp program taking place from January-April 2017. This post is based on his first class project, Exploratory Data Analysis with R (due on the 3rd week of the program).</em></p>
<p> </p>
<div>
<h2>Introduction</h2>
<p>Boston’s bike share program, <a target="_blank" rel="nofollow" href="https://www.thehubway.com/">Hubway</a>, has quickly become a convenient, affordable and fun way to navigate the city. Publicly owned by municipalities in Greater Boston and operated by national bike organization Motivate, Hubway’s increasing popularity is consistent with national trends of greater attention to sustainable transport in metro areas.</p>
<p>Environmental, monetary and convenience benefits aside, bike share programs have embraced the influx of big data collected by their bike/station technology, using the rich datasets for their own business insights as well as posting many of them to the public for any aspiring data scientist to enjoy.</p>
</div>
<div>
<p> </p>
<h2>Data</h2>
<p><strong>Hubway</strong> – the <a target="_blank" rel="nofollow" href="http://hubwaydatachallenge.org/trip-history-data/">Hubway Trip History</a> dataset contains information on over 1M bike trips spanning from the program’s inception in 2011 to mid-2013. Due to long processing times, this dataset was subsetted to only the summer of 2012 (Jun-Sept), which was still inclusive of ~300,000 entries. Information about the variables collected (trip duration, start/end station, rider information) can be found at the site link above.</p>
<p><strong>Zipcodes</strong> – since Hubway includes registered zipcodes for each rider in the trips dataset mentioned above, a comprehensive table of regional zipcodes and their corresponding neighborhood/towns was compiled using the following public sources: <a target="_blank" rel="nofollow" href="http://blog.nycdatascience.com/student-works/r-visualization/hubway-bike-share-ridership-patterns/www.mass.gov/eohhs/docs/dcf/boston-office-by-zipcode.xls">Mass.gov</a>, <a target="_blank" rel="nofollow" href="http://www2.cambridgema.gov/CityOfCambridge_Content/documents/">Cambridge.gov</a>, R package <a target="_blank" rel="nofollow" href="https://cran.r-project.org/web/packages/zipcode/zipcode.pdf">zipcode</a>.</p>
<p><strong>Weather</strong> – public daily weather data for Greater Boston was accessed and tabularized from <a target="_blank" rel="nofollow" href="https://www.wunderground.com/">Weather Underground</a>.</p>
</div>
<div>
<p> </p>
<h2>Analysis</h2>
<div>
<h4>1) Exploration of General Ridership Patterns</h4>
<p>Basic variables provided in the Trip History dataset include the timestamp (minute-level granularity) of departure and arrival for each Hubway trip taken. This allows for analysis of ridership activity from the perspective of our normal temporal routines – commuting, socializing, weekend excursions, etc.</p>
<p>Density plots help to visualize hourly ridership throughout the course of an average weekday or weekend. Here we see an obvious “M” shape on the weekday density curve, very likely due to commuting activity (roughly including weekday hours from 7-9AM and 4-7PM). Further analysis reveals that these commuting rides accounted for <strong>33% of total trips (including weekends) during the summer of 2012</strong>. Average weekend profiles exhibit an opposite daily profile with peak ridership occurring in the afternoons. A small, but noticeable amount of weekend rides occur from 12AM-3AM catering to more ‘adventurous’ biker-bar-goers.</p>
<p><a target="_blank" rel="nofollow" href="https://i1.wp.com/blog.nycdatascience.com/wp-content/uploads/2017/02/hourly_profile_histogram-1.png"><img sizes="(max-width: 1024px) 100vw, 1024px" alt="hourly_profile_histogram-1" class="wp-image-18911" src="https://i0.wp.com/blog.nycdatascience.com/wp-content/uploads/2017/02/hourly_profile_histogram-1-1024x731.png?resize=456%2C326" data-recalc-dims="1"></a></p>
<p>We can further solidify weekday-vs-weekend behavior using density plots as a function of total trips and average trip duration. In the <em>right-hand panel</em> we observe a noticeable difference in the distributions of daily rides – on a given weekday, there are 500-750 more rides than a given weekend. In the <em>left-hand panel</em> we see that the distribution of weekend trips has a mean trip duration of approximately <strong>10 minutes</strong> longer than that of weekday trips, with an average trip time of ~25 mins. Hubway rides max out at 30 minutes, so weekend riders tend to make the most of their riding time. Together, these two observations suggest that Hubway lends itself well to both higher-frequency and faster weekday schedules (commuting) and slower-paced weekend routines (recreational rides and sightseeing).</p>
<p><a target="_blank" rel="nofollow" href="https://i2.wp.com/blog.nycdatascience.com/wp-content/uploads/2017/02/trips_duration_histogram-1.png"><img sizes="(max-width: 1024px) 100vw, 1024px" alt="trips_duration_histogram-1" class="wp-image-18912" src="https://i1.wp.com/blog.nycdatascience.com/wp-content/uploads/2017/02/trips_duration_histogram-1-1024x731.png?resize=456%2C326" data-recalc-dims="1"></a></p>
</div>
<div>
<h4>2) Exploration of Rider Demographics</h4>
<p>The inclusion of rider information (which is gathered at registration for annual membership) provides interesting potential for analysis of Hubway’s demographics. Namely, for each ride in the Trip History dataset, the rider’s zipcode, age and gender is also included. Using the compiled zipcode table previously described, rider zipcodes were matched with boston neighborhoods or surrounding suburbs. The plot below shows the top ten demographic cohorts (i.e. groups of gender-age-neighborhood combinations), by total rides in summer 2012. It is worth noting:</p>
<p>There were no female cohorts in the top ten ridership groups for either Greater Boston or the Suburbs; all cohorts depicted below are male.</p>
<p>Because of the low number of riders from the suburbs, the y-axis for suburban cohorts has been scaled up; however on absolute terms, these rides constitute a significantly lower proportion than Greater Boston residents.</p>
<p><a target="_blank" rel="nofollow" href="https://i1.wp.com/blog.nycdatascience.com/wp-content/uploads/2017/02/demographics_histogram-1.png"><img sizes="(max-width: 1024px) 100vw, 1024px" alt="demographics_histogram-1" class="wp-image-18913" src="https://i1.wp.com/blog.nycdatascience.com/wp-content/uploads/2017/02/demographics_histogram-1-1024x731.png?resize=456%2C326" data-recalc-dims="1"></a></p>
<p>Males, of all ages, from the South End and Back Bay neighborhoods play a very significant role in Hubway’s membership base – in combination they made up <strong>17% of all registered Hubway rides during the summer of 2012</strong>. Trips are also quite popular among male millenials in other densely populated parts of Boston.</p>
<p>Although substantially smaller by trip volume, Hubway appears to have maintained a loyal member base from the suburbs. This segment is dominated by middle-aged males from nearby Boston towns, making heavy use of Hubway stations located at MBTA hubs (commuter rail or ferry), most notably North Station, South Station and Rowes Wharf Ferry Landing (not shown on graph).</p>
</div>
<div>
<p> </p>
<h2>Conclusions</h2>
<p>Hubway has solidified its place as a viable transportation option in Greater Boston, as evidenced by incorporation of bike trips into our daily routines and high adoption among particular demographic groups.</p>
<p>Integration of external datasets could provide further insights into the drivers for increased ridership. To examine the impact of short-term, localized events, use of publicly available subway data could attempt to draw correlations between daily MBTA maintenance/recorded downtime and increased Hubway rides. Schedules of large city-wide events encouraging travel and sight-seeing (Red Sox games, Boston Marathon, 4th of July Fireworks) could also point to ridership spikes. With an eye to longer-term Hubway growth, study of urban planning initiatives (public spaces, increased transit coverage) and commercial/residential development of new neighborhoods could indicate good candidates for new bike stations.</p>
</div>
</div>
<p>The post <a target="_blank" rel="nofollow" href="http://blog.nycdatascience.com/student-works/r-visualization/hubway-bike-share-ridership-patterns/">Hubway Bike Share: Ridership Patterns</a> appeared first on <a target="_blank" rel="nofollow" href="http://blog.nycdatascience.com/">NYC Data Science Academy Blog</a>.</p>
<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://blog.nycdatascience.com/student-works/r-visualization/hubway-bike-share-ridership-patterns/"> R – NYC Data Science Academy Blog</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" rel="nofollow" href="https://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="https://www.r-bloggers.com/search/data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="https://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="https://www.r-bloggers.com/search/map">maps</a>, <a title="Animation in R" rel="nofollow" href="https://www.r-bloggers.com/search/animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="https://www.r-bloggers.com/search/sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="https://www.r-bloggers.com/search/SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="https://www.r-bloggers.com/search/git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="https://www.r-bloggers.com/search/hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="https://www.r-bloggers.com/search/PCA">PCA</a>, <a title="Time series" rel="nofollow" href="https://www.r-bloggers.com/search/time+series">time series</a>, <a title="finance trading" rel="nofollow" href="https://www.r-bloggers.com/search/trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/5VAS4c7Zveg"></a></div>