{"id":10721,"date":"2018-10-09T00:08:30","date_gmt":"2018-10-09T04:08:30","guid":{"rendered":"http:\/\/studentwork.prattsi.org\/infovis\/?p=10721"},"modified":"2019-01-10T23:59:17","modified_gmt":"2019-01-11T04:59:17","slug":"distracted-drivers-in-nyc-looking-at-cyclist-injuries-from-vehicle-collision-over-the-past-year","status":"publish","type":"post","link":"https:\/\/studentwork.prattsi.org\/infovis\/labs\/distracted-drivers-in-nyc-looking-at-cyclist-injuries-from-vehicle-collision-over-the-past-year\/","title":{"rendered":"Distracted Drivers in NYC: Looking at Cyclist Injuries Due to Vehicle Collision from October 2017 &#8211; October 2018"},"content":{"rendered":"<h2><b>Introduction<\/b><\/h2>\n<p><span style=\"font-weight: 400\">As a cyclist who\u2019s relatively new to New York, I\u2019ve been wondering how often bicycle accidents from cars occur in the city, especially after watching a cyclist get hit by a car in front of my apartment last week (don\u2019t worry \u2013 they ended up being fine). I decided to look at the rate of cyclist injuries from vehicle collisions in New York City from October 1, 2017 to October 1, 2018 for Lab 2 of Information Visualization. I\u2019d initially intended to include cyclist deaths by vehicle collision, but according to the <\/span><a href=\"https:\/\/data.cityofnewyork.us\/Public-Safety\/NYPD-Motor-Vehicle-Collisions\/h9gi-nx95\"><span style=\"font-weight: 400\">NYPD Motor Vehicle Collisions dataset from NYC Open Data<\/span><\/a><span style=\"font-weight: 400\">, only 2 cyclist deaths due to vehicle collision occurred in this date range; unfortunately, so did 4,624 injuries. To see the final visualizations, check out <\/span><a href=\"https:\/\/public.tableau.com\/profile\/drew.stanley#!\/vizhome\/Lab2-cleaneddata\/Dashboard1?publish=yes\"><span style=\"font-weight: 400\">my visualization dashboard on Tableau Public<\/span><\/a><span style=\"font-weight: 400\">. <\/span><\/p>\n<h2><b>Inspiration<\/b><\/h2>\n<p><span style=\"font-weight: 400\">The LA Times ran <\/span><span style=\"font-weight: 400\"><a href=\"http:\/\/www.latimes.com\/opinion\/livable-city\/la-ol-livable-data-prevent-cycling-deaths-20151217-htmlstory.html\">a report<\/a> in 2015 on using data to help <\/span><span style=\"font-weight: 400\">save<\/span><span style=\"font-weight: 400\"> cyclist lives<\/span><span style=\"font-weight: 400\">\u00a0that included data on car-on-bike collisions in LA over five years (Figure 1). This definitely inspired my chart on contributing factors that caused a cyclist injury from a vehicle.<\/span><\/p>\n<div id=\"attachment_10725\" style=\"width: 840px\" class=\"wp-caption aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-10725\" class=\"wp-image-10725 size-large\" src=\"https:\/\/i0.wp.com\/studentwork.prattsi.org\/infovis\/wp-content\/uploads\/sites\/3\/2018\/10\/la-ol-livable-data-prevent-cycling-deaths-20151217-map-plus-chart.jpg?resize=840%2C398\" alt=\"\" width=\"840\" height=\"398\" srcset=\"https:\/\/i0.wp.com\/studentwork.prattsi.org\/infovis\/wp-content\/uploads\/sites\/3\/2018\/10\/la-ol-livable-data-prevent-cycling-deaths-20151217-map-plus-chart.jpg?resize=1024%2C485&amp;ssl=1 1024w, https:\/\/i0.wp.com\/studentwork.prattsi.org\/infovis\/wp-content\/uploads\/sites\/3\/2018\/10\/la-ol-livable-data-prevent-cycling-deaths-20151217-map-plus-chart.jpg?resize=300%2C142&amp;ssl=1 300w, https:\/\/i0.wp.com\/studentwork.prattsi.org\/infovis\/wp-content\/uploads\/sites\/3\/2018\/10\/la-ol-livable-data-prevent-cycling-deaths-20151217-map-plus-chart.jpg?resize=768%2C364&amp;ssl=1 768w, https:\/\/i0.wp.com\/studentwork.prattsi.org\/infovis\/wp-content\/uploads\/sites\/3\/2018\/10\/la-ol-livable-data-prevent-cycling-deaths-20151217-map-plus-chart.jpg?w=2048&amp;ssl=1 2048w, https:\/\/i0.wp.com\/studentwork.prattsi.org\/infovis\/wp-content\/uploads\/sites\/3\/2018\/10\/la-ol-livable-data-prevent-cycling-deaths-20151217-map-plus-chart.jpg?w=1680 1680w\" sizes=\"auto, (max-width: 840px) 100vw, 840px\" \/><p id=\"caption-attachment-10725\" class=\"wp-caption-text\">Figure 1 (LA Times\/DataScience)<\/p><\/div>\n<p>Looking at various kinds of part-to-whole charts, I decided to go with a stacked area chart like the visualization from ChartBlocks in Figure 2 to show cyclist injuries by city borough.<\/p>\n<div id=\"attachment_10728\" style=\"width: 800px\" class=\"wp-caption aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-10728\" class=\"wp-image-10728 size-full\" src=\"https:\/\/i0.wp.com\/studentwork.prattsi.org\/infovis\/wp-content\/uploads\/sites\/3\/2018\/10\/Browser-trends.png?resize=800%2C450\" alt=\"\" width=\"800\" height=\"450\" srcset=\"https:\/\/i0.wp.com\/studentwork.prattsi.org\/infovis\/wp-content\/uploads\/sites\/3\/2018\/10\/Browser-trends.png?w=800&amp;ssl=1 800w, https:\/\/i0.wp.com\/studentwork.prattsi.org\/infovis\/wp-content\/uploads\/sites\/3\/2018\/10\/Browser-trends.png?resize=300%2C169&amp;ssl=1 300w, https:\/\/i0.wp.com\/studentwork.prattsi.org\/infovis\/wp-content\/uploads\/sites\/3\/2018\/10\/Browser-trends.png?resize=768%2C432&amp;ssl=1 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><p id=\"caption-attachment-10728\" class=\"wp-caption-text\">Figure 2 (ChartBlocks)<\/p><\/div>\n<h2><b>Materials<\/b><\/h2>\n<p><span style=\"font-weight: 400\">The dataset used in this project was the <\/span><a href=\"https:\/\/data.cityofnewyork.us\/Public-Safety\/NYPD-Motor-Vehicle-Collisions\/h9gi-nx95\"><span style=\"font-weight: 400\">NYPD Motor Vehicle Collisions dataset<\/span><\/a><span style=\"font-weight: 400\">, downloaded from <\/span><a href=\"https:\/\/opendata.cityofnewyork.us\/\"><span style=\"font-weight: 400\">NYC Open Data<\/span><\/a>\u00a0and filtered by date range using\u00a0<a href=\"https:\/\/data.cityofnewyork.us\/NYC-BigApps\/NYPD-Motor-Vehicle-Collisions-Summary\/m666-sf2m\"><span style=\"font-weight: 400\">NYPD Motor Vehicle Collisions Summary<\/span><\/a><span style=\"font-weight: 400\"> and <a href=\"http:\/\/sheets.google.com\">Google Sheets<\/a> to combine two sets of the filtered data<\/span><span style=\"font-weight: 400\">. After uploading into <\/span><a href=\"http:\/\/openrefine.org\/\"><span style=\"font-weight: 400\">Open Refine<\/span><\/a><span style=\"font-weight: 400\"> for some cleanup, I then used the cleaned data in <\/span><a href=\"https:\/\/public.tableau.com\/s\/\"><span style=\"font-weight: 400\">Tableau Public<\/span><\/a><span style=\"font-weight: 400\"> to make the visualizations. I also used <\/span><a href=\"http:\/\/google.com\/maps\"><span style=\"font-weight: 400\">Google Maps<\/span><\/a><span style=\"font-weight: 400\"> to look up the latitude\/longitude of null (empty) values in the \u201cBorough\u201d column of the dataset during the cleanup process.<\/span><\/p>\n<h2><b>Methods<\/b><\/h2>\n<h4><b>The dataset<\/b><\/h4>\n<p><span style=\"font-weight: 400\">The full date range of <\/span><a href=\"https:\/\/data.cityofnewyork.us\/Public-Safety\/NYPD-Motor-Vehicle-Collisions\/h9gi-nx95\"><span style=\"font-weight: 400\">the dataset that I used<\/span><\/a><span style=\"font-weight: 400\"> goes all the way back to 2012, racking up about 1.35 million rows of raw data in the entire table. Since I was only interested in the past year, I decided to only go back to October 2017 before downloading by using the date filter on <\/span><a href=\"https:\/\/data.cityofnewyork.us\/NYC-BigApps\/NYPD-Motor-Vehicle-Collisions-Summary\/m666-sf2m\"><span style=\"font-weight: 400\">NYPD Motor Vehicle Collisions Summary<\/span><\/a><span style=\"font-weight: 400\">, which uses the same original dataset. I had to first download two CSV files, one where the crash that occurred resulted in one cyclist injury and another where the crash that occurred involved two cyclist injuries. I then combined both of those sheets using Google Sheets, downloaded the resulting CSV, and then uploaded into Open Refine. I chose not to link the Google Sheet to Open Refine because I wanted to work on a copy of the table from my hard drive, but I also saved a backup copy of the cleaned data as a Google Sheet just in case. <\/span><\/p>\n<h4><b>Data cleanup <\/b><\/h4>\n<p><span style=\"font-weight: 400\">After uploading the CSV into <\/span><a href=\"http:\/\/openrefine.org\/\"><span style=\"font-weight: 400\">Open Refine<\/span><\/a><span style=\"font-weight: 400\">, I clustered together any duplicate cell values in the Contributing Factor column. Since this was the only column that had any duplicate cell values that needed to be clustered, I then checked for any leading or trailing white space in the table.<\/span><\/p>\n<p><span style=\"font-weight: 400\">Wanting to show cyclist injuries by borough, it was important to me that this part of the data be as accurate as it could be. Unfortunately, this dataset had 1,322 null values for borough location in this date range, but it did provide an almost complete set of latitude\/longitude numbers to work off of. Using these, I plugged each coordinate into Google Maps to manually look up each missing value to assign to a borough. Although tedious, this brought the null value count in the Borough column down from 1,323 to 64 and offered a much more accurate picture of the number of cyclist injuries across the city as a whole.<\/span><\/p>\n<h4><b>Deciding on types of visualizations<\/b><\/h4>\n<p><span style=\"font-weight: 400\">For the first visualization, I wanted to show cyclist injuries over time by borough, so I decided to use a stacked area chart filtered by each of the five boroughs in New York City with the 64 null values filtered out. One dimension of this dataset that I thought was important to show was to include <\/span><i><span style=\"font-weight: 400\">why<\/span><\/i><span style=\"font-weight: 400\"> these crashes happened, and so I used a horizontal bar chart that categorizes contributing factors sorted by magnitude as my second visualization. I chose to go with a color palette that was color blind safe for both. <\/span><\/p>\n<p><span style=\"font-weight: 400\">I had initially mapped out each bicycle crash onto a map of New York City using latitude\/longitude coordinates, but then decided it would be better to focus on visualization techniques that didn\u2019t include map coordinates for this lab. While being able to see where each injury occurred in the city and where they most frequently happened is important, I think I\u2019m going to revisit mapping this dataset after our class goes over Carto, a much more powerful tool for mapping data. <\/span><\/p>\n<h4><b>Screen layouts in Tableau<\/b><\/h4>\n<p><span style=\"font-weight: 400\">After I was happy with how my visualizations looked, I added them to a dashboard in Tableau and then added a screen layout for mobile, tablet, and desktop views. Much like using media rules in a CSS stylesheet, these screen layouts automatically adjust how the visualizations look on a dashboard depending on the viewer\u2019s screen size. <\/span><\/p>\n<h2><b>Results and Interpretations<\/b><\/h2>\n<div id=\"attachment_10730\" style=\"width: 1392px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/public.tableau.com\/profile\/drew.stanley#!\/vizhome\/Lab2-cleaneddata\/LineArea\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-10730\" class=\"wp-image-10730 size-full\" src=\"https:\/\/i0.wp.com\/studentwork.prattsi.org\/infovis\/wp-content\/uploads\/sites\/3\/2018\/10\/Screen-Shot-2018-10-08-at-11.28.18-PM.png?resize=840%2C352\" alt=\"\" width=\"840\" height=\"352\" srcset=\"https:\/\/i0.wp.com\/studentwork.prattsi.org\/infovis\/wp-content\/uploads\/sites\/3\/2018\/10\/Screen-Shot-2018-10-08-at-11.28.18-PM.png?w=1392&amp;ssl=1 1392w, https:\/\/i0.wp.com\/studentwork.prattsi.org\/infovis\/wp-content\/uploads\/sites\/3\/2018\/10\/Screen-Shot-2018-10-08-at-11.28.18-PM.png?resize=300%2C126&amp;ssl=1 300w, https:\/\/i0.wp.com\/studentwork.prattsi.org\/infovis\/wp-content\/uploads\/sites\/3\/2018\/10\/Screen-Shot-2018-10-08-at-11.28.18-PM.png?resize=768%2C322&amp;ssl=1 768w, https:\/\/i0.wp.com\/studentwork.prattsi.org\/infovis\/wp-content\/uploads\/sites\/3\/2018\/10\/Screen-Shot-2018-10-08-at-11.28.18-PM.png?resize=1024%2C429&amp;ssl=1 1024w\" sizes=\"auto, (max-width: 840px) 100vw, 840px\" \/><\/a><p id=\"caption-attachment-10730\" class=\"wp-caption-text\">Figure 3 &#8211; August was the worst month for cyclist injuries in New York City, especially in Brooklyn (<a href=\"https:\/\/public.tableau.com\/profile\/drew.stanley#!\/vizhome\/Lab2-cleaneddata\/LineArea\"><strong>view in Tableau Public<\/strong><\/a>).<\/p><\/div>\n<p><span style=\"font-weight: 400\">In Figure 3, there was a downward trend in cyclist injuries from October 2017 until February 2018. Presumably as the outside temperatures started to warm up and more New Yorkers started riding their bikes again, the trend started to climb upward from February 2018 to August 2018, when the highest number of cyclists were injured.<\/span><\/p>\n<div id=\"attachment_10729\" style=\"width: 1393px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/public.tableau.com\/profile\/drew.stanley#!\/vizhome\/Lab2-cleaneddata\/HorizontalBars\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-10729\" class=\"wp-image-10729 size-full\" src=\"https:\/\/i0.wp.com\/studentwork.prattsi.org\/infovis\/wp-content\/uploads\/sites\/3\/2018\/10\/Screen-Shot-2018-10-08-at-11.23.17-PM.png?resize=840%2C349\" alt=\"\" width=\"840\" height=\"349\" srcset=\"https:\/\/i0.wp.com\/studentwork.prattsi.org\/infovis\/wp-content\/uploads\/sites\/3\/2018\/10\/Screen-Shot-2018-10-08-at-11.23.17-PM.png?w=1393&amp;ssl=1 1393w, https:\/\/i0.wp.com\/studentwork.prattsi.org\/infovis\/wp-content\/uploads\/sites\/3\/2018\/10\/Screen-Shot-2018-10-08-at-11.23.17-PM.png?resize=300%2C124&amp;ssl=1 300w, https:\/\/i0.wp.com\/studentwork.prattsi.org\/infovis\/wp-content\/uploads\/sites\/3\/2018\/10\/Screen-Shot-2018-10-08-at-11.23.17-PM.png?resize=768%2C319&amp;ssl=1 768w, https:\/\/i0.wp.com\/studentwork.prattsi.org\/infovis\/wp-content\/uploads\/sites\/3\/2018\/10\/Screen-Shot-2018-10-08-at-11.23.17-PM.png?resize=1024%2C425&amp;ssl=1 1024w\" sizes=\"auto, (max-width: 840px) 100vw, 840px\" \/><\/a><p id=\"caption-attachment-10729\" class=\"wp-caption-text\">Figure 4 &#8211; Driver inattention\/distraction continues to be the leading cause of cyclist injuries, according to NYPD Motor Vehicle Collisions data (<a href=\"https:\/\/public.tableau.com\/profile\/drew.stanley#!\/vizhome\/Lab2-cleaneddata\/HorizontalBars\"><strong>view in Tableau Public<\/strong><\/a>).<\/p><\/div>\n<p><span style=\"font-weight: 400\">In Figure 4, we can see that the majority of contributing factors for these crashes and subsequent injuries were because of driver distraction. The second-most common contributing factor was failing to yield right-of-way, and the third most common was pedestrian or cyclist error\/confusion. The utmost interpretation here \u2013\u00a0<\/span><a href=\"https:\/\/crashstats.nhtsa.dot.gov\/Api\/Public\/ViewPublication\/812456\"><span style=\"font-weight: 400\">perhaps unsurprisingly<\/span><\/a><span style=\"font-weight: 400\"> \u2013\u00a0is that distracted driving continues to be a major problem in the city. The good news is that cycling is still a relatively safe mode of transportation, with <\/span><a href=\"https:\/\/www.nytimes.com\/2017\/07\/30\/nyregion\/new-yorkers-bike-lanes-commuting.html\"><span style=\"font-weight: 400\">450,000 trips being taken per day<\/span><\/a><span style=\"font-weight: 400\">.\u00a0To see the final visualizations, check out <a href=\"https:\/\/public.tableau.com\/profile\/drew.stanley#!\/vizhome\/Lab2-cleaneddata\/Dashboard1?publish=yes\">my visualization dashboard on Tableau Public<\/a>.<\/span><\/p>\n<p><b>Reflections for the future<\/b><\/p>\n<p><span style=\"font-weight: 400\">I hope to learn more tools to help automate filling in some of the blanks that datasets can come with. Although this data was relatively clean and well-compiled, there were quite a few blank cells or null values, particularly when it came to which borough these bicycle injuries from vehicle crashes occurred in and their contributing factors. I\u2019d initially thought of using the latitude\/longitude data using the Google Maps API to fill in the blanks for which borough each crash occurred in, but this came with restrictions and wouldn\u2019t have been worth it. Ultimately, I manually filled in the empty borough column cells using locational data provided and plugging each into Google Maps. I then filtered out the other null values that didn\u2019t have any apparent location, which yielded better results in the visualization. As it goes in our field, the bulk of the work is cleaning up and organizing the data.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400\">Since creating these visualizations, I discovered that the New York Department of Transportation also releases data on bicycle crashes in their <\/span><a href=\"http:\/\/www.nyc.gov\/html\/dot\/downloads\/pdf\/bicycle-crash-data-report-2017.pdf\"><span style=\"font-weight: 400\">Bicycle Crash Data Report<\/span><\/a><span style=\"font-weight: 400\">. In future work, it would be useful to compare similar datasets like these to see if there are any differences and to investigate why. <\/span><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction As a cyclist who\u2019s relatively new to New York, I\u2019ve been wondering how often bicycle accidents from cars occur in the city, especially after watching a cyclist get hit by a car in front of my apartment last week (don\u2019t worry \u2013 they ended up being fine). I decided to look at the rate&hellip;<\/p>\n","protected":false},"author":549,"featured_media":10730,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[340,149],"tags":[258,233,260,195,123,259],"coauthors":[327],"class_list":["post-10721","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-charts","category-labs","tag-area-chart","tag-drew-stanley","tag-horizontal-bar-chart","tag-nyc-open-data","tag-tableau-public","tag-temporal-data"],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/studentwork.prattsi.org\/infovis\/wp-content\/uploads\/sites\/3\/2018\/10\/Screen-Shot-2018-10-08-at-11.28.18-PM.png?fit=1392%2C583&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/paBdcV-2MV","_links":{"self":[{"href":"https:\/\/studentwork.prattsi.org\/infovis\/wp-json\/wp\/v2\/posts\/10721","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/studentwork.prattsi.org\/infovis\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/studentwork.prattsi.org\/infovis\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/studentwork.prattsi.org\/infovis\/wp-json\/wp\/v2\/users\/549"}],"replies":[{"embeddable":true,"href":"https:\/\/studentwork.prattsi.org\/infovis\/wp-json\/wp\/v2\/comments?post=10721"}],"version-history":[{"count":10,"href":"https:\/\/studentwork.prattsi.org\/infovis\/wp-json\/wp\/v2\/posts\/10721\/revisions"}],"predecessor-version":[{"id":10738,"href":"https:\/\/studentwork.prattsi.org\/infovis\/wp-json\/wp\/v2\/posts\/10721\/revisions\/10738"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/studentwork.prattsi.org\/infovis\/wp-json\/wp\/v2\/media\/10730"}],"wp:attachment":[{"href":"https:\/\/studentwork.prattsi.org\/infovis\/wp-json\/wp\/v2\/media?parent=10721"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/studentwork.prattsi.org\/infovis\/wp-json\/wp\/v2\/categories?post=10721"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/studentwork.prattsi.org\/infovis\/wp-json\/wp\/v2\/tags?post=10721"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/studentwork.prattsi.org\/infovis\/wp-json\/wp\/v2\/coauthors?post=10721"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}