John Pace
  • Home
  • About
  • Contact

​​
​
Data Scientist, husband, father of 3 great daughters, 5x Ironman triathlon finisher, just a normal guy who spent a lot of time in school.
Let’s explore data science, artificial intelligence, machine learning, and other topics together.

Visualizing Bicycle Commuting Around Universities

1/4/2018

0 Comments

 
Picture
https://prodifycycling.com/wp-content/uploads/2018/10/collegebikes.jpg

​Lately I have been working on a project to try to predict where cycling infrastructure should be built in order to increase bicycle commuting.  This is an important project because it has the potential to help decrease traffic while improving the health of commuters.  Cycling infrastructure is expensive to build, particularly in areas that are already developed.  If accurate predictions can be made, urban planner can make informed, statistically-based decisions that will maximize effectiveness while minimizing capital costs.

One of my initial findings is that bicycle commuting is particularly high around universities and colleges.  While this is not shocking since many of the commuters are potentially college students or university faculty and staff who live very close to campus, it is important because it demonstrates a significant need for safe cycling infrastructure.

While statistics are important, visual presentations can have a much more striking impact.  Using R, I created a visualization to show of the amount of bicycle commuting around several major universities.  The geography is broken into sections called Census Tracts.  A census tract can be thought of a neighborhood.  Each census tract in the visual is color coded according the percentage of residents who commute to work via bicycle.

The data for the visual was obtained from the US Census Bureau's American Community Survey (ACS) using the 2012-2016 American Community Survey 5-Year Estimates.  I used table B8301 - Means of Transportation to Work for all Census Tracts in Texas.  This table has a large number of features, but I was only interested in a few:
  • Census Tract identification number (field GEOID2)
  • Estimate of number of residents in the Census Tract (field HD01_VD01)
  • Estimate of number of cyclists in the Census Tract (field HD01_VD18)

I also picked a sample of 13 Texas universities.  For each, I found the address, county, Census Tract identification number, and latitude/longitude coordinates.

In R, I used several libraries:

  • The Kyle Walker's Tigris library will find all counties and census tracts (as well as other information) for each state and download the shape files that are used to draw the census tracts on maps.
  • SP provides spatial coordinates.
  • Leaflet and ggmaps are used to draw the maps.

The code for creating the visual is below:

    

This will produce the following map.  Each of the blue markers is a university.
​
Picture

If we zoom in on one of the markers, Texas A&M University in College Station, TX, we can see the outline of Brazos County, in which it is located (yellow area).

Picture

Zooming in a little closer and clicking on the blue marker, we see the information about Texas A&M.  There is quite a bit of information in this small area.  The university is located in census tract 48041002015.  11.6% of the residents (148/1272) commute to work via bicycle.  The university is also located in a census tract that is colored dark purple.  Looking at the legend, we see that this represents over 10% bicycle commuters.  So just by looking at the color of the census tract, we can see that it has a high percentage of bicycle commuters.  Clicking on the marker allows us to drill down and get more detailed information.  We can also see that the surrounding census tracts also have high percentages of residents who commute via bicycle (notice the red and dark orange shapes).  This is a great way for a non-technical audience member to see a lot of information very quickly.
​
Picture

​I hope this has been helpful.

If you have questions and want to connect, you can message me on LinkedIn or Twitter. Also, follow me on Twitter @pacejohn, LinkedIn https://www.linkedin.com/in/john-pace-phd-20b87070/, and follow my company, Mark III Systems, on Twitter @markiiisystems

#datascience #machinelearning #tigris #R #bicycle #college #tamu #texas #collegestation #cycling #census #acs #leaflet #ggmaps
0 Comments



Leave a Reply.

    Archives

    November 2020
    September 2020
    August 2020
    June 2020
    May 2020
    April 2020
    March 2020
    February 2020
    January 2020
    December 2019
    November 2019
    October 2019
    September 2019
    August 2019
    May 2019
    April 2019
    March 2019
    April 2018
    March 2018
    January 2018
    November 2017

    Tweets by pacejohn
Proudly powered by Weebly
  • Home
  • About
  • Contact