<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Brenno Martins on Medium]]></title>
        <description><![CDATA[Stories by Brenno Martins on Medium]]></description>
        <link>https://medium.com/@brennovmh?source=rss-3736f24cd169------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*wd48mqXh3qDSR16o</url>
            <title>Stories by Brenno Martins on Medium</title>
            <link>https://medium.com/@brennovmh?source=rss-3736f24cd169------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 22:41:04 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@brennovmh/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How Does a Bike-Share Navigate Speedy to Success?]]></title>
            <link>https://medium.com/@brennovmh/how-does-a-bike-share-navigate-speedy-to-success-2f5231260ca7?source=rss-3736f24cd169------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f5231260ca7</guid>
            <category><![CDATA[google-data-analytics]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[r-programming]]></category>
            <category><![CDATA[coursera]]></category>
            <dc:creator><![CDATA[Brenno Martins]]></dc:creator>
            <pubDate>Sat, 28 May 2022 21:51:14 GMT</pubDate>
            <atom:updated>2022-05-28T21:51:14.690Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/293/1*nPqUTH1pkj8BWtQrd8WYIg.png" /></figure><blockquote>This project is presented as requirement to obtain the Professional Google Data Analytics Certificate. I will follow the steps of the data analysis process: ask, prepare, process, analyze, share, and act to present the results of my analysis.</blockquote><blockquote>Cyclistic is bike-share program that features more than 5,800 bicycles and 600 docking stations. Cyclistic sets itself apart by also offering reclining bikes, hand tricycles, and cargo bikes, making bike-share more inclusive to people with disabilities and riders who can’t use a standard two-wheeled bike. The majority of riders opt for traditional bikes; about 8% of riders use the assistive options. Cyclistic users are more likely to ride for leisure, but about 30% use them to commute to work each day.</blockquote><h3>Ask Phase</h3><p><em>How do annual members and casual riders use Cyclist bikes differently?</em></p><p>The main purpose of this analytical process is to gain insight to understand the critical diferences between annual members and casual riders. Based on that we can use this observations to supply evidence for a data-driven decision analysis.</p><h3>Prepare Phase</h3><p>To start the analysis the files were downloaded from source available at <a href="https://divvy-tripdata.s3.amazonaws.com/index.html">https://divvy-tripdata.s3.amazonaws.com/index.html</a>. The data was available as 42 .zip files, each file contaning data on trips and Cyclist stations. I used Linux shell commands to extrarct files and separate then according to its characteristics, such as: tripdata, stations and trips.</p><p>The following code was used to create directories:</p><p>$ mkdir tripdata station trips</p><p>Then the files were moved accordingly:</p><p>$ mv *tripdata.csv tripdata</p><p>$ mv *stations*.csv station</p><p>$ mv *Trips*.csv trips</p><p>I entenred the tripdata directory to read the .csv files into R.<br>First I renamed the files using the following code:</p><pre>original_name &lt;- c(list.files())</pre><pre>new_name &lt;- c(&quot;trips_april20.csv&quot;, <br>              &quot;trips_may20.csv&quot;, <br>              &quot;trips_june20.csv&quot;, <br>              &quot;trips_jully20.csv&quot;,<br>              &quot;trips_august20.csv&quot;, <br>              &quot;trips_september20.csv&quot;,<br>              &quot;trips_october20.csv&quot;,<br>              &quot;trips_november20.csv&quot;, <br>              &quot;trips_december20.csv&quot;,<br>              &quot;trips_jan21.csv&quot;,<br>              &quot;trips_feb21.csv&quot;,<br>              &quot;trips_mar21.csv&quot;,<br>              &quot;trips_april21.csv&quot;,<br>              &quot;trips_may21.csv&quot;,<br>              &quot;trips_june21.csv&quot;, <br>              &quot;trips_jully21.csv&quot;,<br>              &quot;trips_august21.csv&quot;,<br>              &quot;trips_september21.csv&quot;,<br>              &quot;trips_october21.csv&quot;,<br>              &quot;trips_november21.csv&quot;,<br>              &quot;trips_december21.csv&quot;,<br>              &quot;trips_jan22.csv&quot;,<br>              &quot;trips_feb22.csv&quot;, <br>              &quot;trips_mar22.csv&quot;)</pre><pre>length(original_name) ## = 24<br>length(new_name)      ## = 24<br>file.rename(original_name, new_name)</pre><p>And then used read.csv() to read the files as follows:</p><pre>filenames &lt;- gsub(&quot;\\.csv$&quot;,&quot;&quot;, list.files(pattern =&quot;\\.csv$&quot;))</pre><pre>for(i in filenames){<br>  assign(i, read.csv(paste(i, &quot;.csv&quot;, sep=&quot;&quot;)))<br>}</pre><p>The data is organized in millions of observations arranged in 13 variables: [1] “ride_id”, “rideable_type”, “started_at”, “ended_at” ,“start_station_name”, “start_station_id”, “end_station_name” ,“end_station_id” , “start_lat”, “start_lng”, “end_lat”, “end_lng” ,“member_casual”.</p><p>I changed the directory and used the same code to load data about cyclist stations. I then realized that the data frame “Divvy_Stations_2017_Q3Q4” and “Divvy_Stations_2017_Q1Q2” had one extra row without data.</p><pre>Divvy_Stations_2015 &lt;- Divvy_Stations_2015[-c(0,6)]<br>Divvy_Stations_2016_Q3 &lt;- Divvy_Stations_2016_Q3[-c(0,6)]<br>Divvy_Stations_2016_Q4 &lt;- Divvy_Stations_2016_Q4[-c(0,6)]<br>Divvy_Stations_2017_Q1Q2 &lt;- Divvy_Stations_2017_Q1Q2[-c(0,3)]<br>Divvy_Stations_2017_Q1Q2 &lt;- Divvy_Stations_2017_Q1Q2[-c(0,6)]<br>Divvy_Stations_2017_Q3Q4 &lt;- Divvy_Stations_2017_Q3Q4[-c(0,3)]<br>Divvy_Stations_2017_Q3Q4 &lt;- Divvy_Stations_2017_Q3Q4[-c(0,6)]</pre><h3>Process Phase</h3><p>After loading the data into R I started processing it to further analysis. First I combined the daraframes in one big data frame named total_trips_final containing data about the last 12 months.</p><pre>total_trips_final &lt;- rbind(trips_mar21,<br>                     trips_april21,<br>                     trips_may21,<br>                     trips_june21, <br>                     trips_jully21,<br>                     trips_august21,<br>                     trips_september21,<br>                     trips_october21,<br>                     trips_november21,<br>                     trips_december21,<br>                     trips_jan22,<br>                     trips_feb22, <br>                     trips_mar22)</pre><p>The case study workflow suggestd to create a column called “ride_length”. I did so using R.</p><pre>library(&quot;hms&quot;)</pre><pre>ride_length &lt;- difftime(total_trips_final$ended_at, total_trips_final$started_at)<br>as_hms(ride_length) -&gt; ride_length<br>View(ride_length)</pre><pre>## Adding ride_length to my dataframe</pre><pre>total_trips_final2 &lt;- mutate(total_trips_final, ride_length = ride_length)<br>head(total_trips_final2)</pre><p>I used the same strategy to add a column named “day_of_week”.</p><pre>strftime(total_trips_final2$started_at, &quot;%A&quot;) -&gt; day_of_week</pre><pre>total_trips_final2 &lt;- mutate(total_trips_final2, day_of_week = day_of_week)</pre><p>After all I decided to inspect the new table created.</p><pre>&gt; colnames(total_trips_final2)</pre><pre>[1] &quot;ride_id&quot;            &quot;rideable_type&quot;      &quot;started_at&quot;         &quot;ended_at&quot;</pre><pre>[5] &quot;start_station_name&quot; &quot;start_station_id&quot;   &quot;end_station_name&quot;   &quot;end_station_id&quot;</pre><pre>[9] &quot;start_lat&quot;          &quot;start_lng&quot;          &quot;end_lat&quot;            &quot;end_lng&quot;</pre><pre>[13] &quot;member_casual&quot;      &quot;ride_length&quot;        &quot;day_of_week&quot;</pre><pre>&gt; nrow(total_trips_final2)</pre><pre>[1] 5952028</pre><pre>&gt; dim(total_trips_final2)</pre><pre>[1] 5952028      15</pre><pre>&gt; head(total_trips_final2)</pre><pre>ride_id rideable_type          started_at            ended_at</pre><pre>1 CFA86D4455AA1030  classic_bike 2021-03-16 08:32:30 2021-03-16 08:36:34</pre><pre>2 30D9DC61227D1AF3  classic_bike 2021-03-28 01:26:28 2021-03-28 01:36:55</pre><pre>3 846D87A15682A284  classic_bike 2021-03-11 21:17:29 2021-03-11 21:33:53</pre><pre>4 994D05AA75A168F2  classic_bike 2021-03-11 13:26:42 2021-03-11 13:55:41</pre><pre>5 DF7464FBE92D8308  classic_bike 2021-03-21 09:09:37 2021-03-21 09:27:33</pre><pre>6 CEBA8516FD17F8D8  classic_bike 2021-03-20 11:08:47 2021-03-20 11:29:39</pre><pre>start_station_name start_station_id                    end_station_name</pre><pre>1 Humboldt Blvd &amp; Armitage Ave            15651             Stave St &amp; Armitage Ave</pre><pre>2 Humboldt Blvd &amp; Armitage Ave            15651 Central Park Ave &amp; Bloomingdale Ave</pre><pre>3        Shields Ave &amp; 28th Pl            15443                Halsted St &amp; 35th St</pre><pre>4  Winthrop Ave &amp; Lawrence Ave     TA1308000021              Broadway &amp; Sheridan Rd</pre><pre>5     Glenwood Ave &amp; Touhy Ave              525           Chicago Ave &amp; Sheridan Rd</pre><pre>6     Glenwood Ave &amp; Touhy Ave              525           Chicago Ave &amp; Sheridan Rd</pre><pre>end_station_id start_lat start_lng  end_lat   end_lng member_casual ride_length</pre><pre>1          13266  41.91751 -87.70181 41.91774 -87.69139        casual    00:04:04</pre><pre>2          18017  41.91751 -87.70181 41.91417 -87.71676        casual    00:10:27</pre><pre>3   TA1308000043  41.84273 -87.63549 41.83066 -87.64717        casual    00:16:24</pre><pre>4          13323  41.96881 -87.65766 41.95283 -87.64999        casual    00:28:59</pre><pre>5           E008  42.01270 -87.66606 42.05049 -87.67782        casual    00:17:56</pre><pre>6           E008  42.01270 -87.66606 42.05049 -87.67782        casual    00:20:52</pre><pre>day_of_week</pre><pre>1     Tuesday</pre><pre>2      Sunday</pre><pre>3    Thursday</pre><pre>4    Thursday</pre><pre>5      Sunday</pre><pre>6    Saturday</pre><pre>&gt; str(total_trips_final2)</pre><pre>&#39;data.frame&#39;:     5952028 obs. of  15 variables:</pre><pre>$ ride_id           : chr  &quot;CFA86D4455AA1030&quot; &quot;30D9DC61227D1AF3&quot; &quot;846D87A15682A284&quot; &quot;994D05AA75A168F2&quot; ...</pre><pre>$ rideable_type     : chr  &quot;classic_bike&quot; &quot;classic_bike&quot; &quot;classic_bike&quot; &quot;classic_bike&quot; ...</pre><pre>$ started_at        : chr  &quot;2021-03-16 08:32:30&quot; &quot;2021-03-28 01:26:28&quot; &quot;2021-03-11 21:17:29&quot; &quot;2021-03-11 13:26:42&quot; ...</pre><pre>$ ended_at          : chr  &quot;2021-03-16 08:36:34&quot; &quot;2021-03-28 01:36:55&quot; &quot;2021-03-11 21:33:53&quot; &quot;2021-03-11 13:55:41&quot; ...</pre><pre>$ start_station_name: chr  &quot;Humboldt Blvd &amp; Armitage Ave&quot; &quot;Humboldt Blvd &amp; Armitage Ave&quot; &quot;Shields Ave &amp; 28th Pl&quot; &quot;Winthrop Ave &amp; Lawrence Ave&quot; ...</pre><pre>$ start_station_id  : chr  &quot;15651&quot; &quot;15651&quot; &quot;15443&quot; &quot;TA1308000021&quot; ...</pre><pre>$ end_station_name  : chr  &quot;Stave St &amp; Armitage Ave&quot; &quot;Central Park Ave &amp; Bloomingdale Ave&quot; &quot;Halsted St &amp; 35th St&quot; &quot;Broadway &amp; Sheridan Rd&quot; ...</pre><pre>$ end_station_id    : chr  &quot;13266&quot; &quot;18017&quot; &quot;TA1308000043&quot; &quot;13323&quot; ...</pre><pre>$ start_lat         : num  41.9 41.9 41.8 42 42 ...</pre><pre>$ start_lng         : num  -87.7 -87.7 -87.6 -87.7 -87.7 ...</pre><pre>$ end_lat           : num  41.9 41.9 41.8 42 42.1 ...</pre><pre>$ end_lng           : num  -87.7 -87.7 -87.6 -87.6 -87.7 ...</pre><pre>$ member_casual     : chr  &quot;casual&quot; &quot;casual&quot; &quot;casual&quot; &quot;casual&quot; ...</pre><pre>$ ride_length       : &#39;hms&#39; num  00:04:04 00:10:27 00:16:24 00:28:59 ...</pre><pre>..- attr(*, &quot;units&quot;)= chr &quot;secs&quot;</pre><pre>$ day_of_week       : chr  &quot;Tuesday&quot; &quot;Sunday&quot; &quot;Thursday&quot; &quot;Thursday&quot; ...</pre><pre>&gt; summary(total_trips_final2)</pre><pre>ride_id          rideable_type       started_at          ended_at</pre><pre>Length:5952028     Length:5952028     Length:5952028     Length:5952028</pre><pre>Class :character   Class :character   Class :character   Class :character</pre><pre>Mode  :character   Mode  :character   Mode  :character   Mode  :character</pre><pre>start_station_name start_station_id   end_station_name   end_station_id</pre><pre>Length:5952028     Length:5952028     Length:5952028     Length:5952028</pre><pre>Class :character   Class :character   Class :character   Class :character</pre><pre>Mode  :character   Mode  :character   Mode  :character   Mode  :character</pre><pre>start_lat       start_lng         end_lat         end_lng       member_casual</pre><pre>Min.   :41.64   Min.   :-87.84   Min.   :41.39   Min.   :-88.97   Length:5952028</pre><pre>1st Qu.:41.88   1st Qu.:-87.66   1st Qu.:41.88   1st Qu.:-87.66   Class :character</pre><pre>Median :41.90   Median :-87.64   Median :41.90   Median :-87.64   Mode  :character</pre><pre>Mean   :41.90   Mean   :-87.65   Mean   :41.90   Mean   :-87.65</pre><pre>3rd Qu.:41.93   3rd Qu.:-87.63   3rd Qu.:41.93   3rd Qu.:-87.63</pre><pre>Max.   :45.64   Max.   :-73.80   Max.   :42.17   Max.   :-87.49</pre><pre>NA&#39;s   :4883    NA&#39;s   :4883</pre><pre>ride_length       day_of_week</pre><pre>Length:5952028    Length:5952028</pre><pre>Class1:hms        Class :character</pre><pre>Class2:difftime   Mode  :character</pre><pre>Mode  :numeric</pre><p>I was considering to use the columns “end_lat” and “end_long”, but since both have a significant amount of NAs, I decided to delete them.</p><pre>total_trips_final2 &lt;- total_trips_final2 %&gt;% <br>  select(-c(end_lat, end_lng))</pre><p>The code provided alongside the project suggested check the “member_casual” variable to see distinct values on it. I did so and realized that no change was needed.</p><pre>unique(total_trips_final2$member_casual)</pre><pre>[1] &quot;casual&quot; &quot;member&quot;</pre><p>Since there are some negative values in ride_length I removed them using the following code:</p><pre>total_trips_final2 %&gt;% <br>  filter(ride_length &gt;= 0) -&gt; total_trips_final2</pre><h3>Analyze Phase</h3><p>To begin the descriptive analysis I checked the ride_length variable.</p><pre>summary(ride_length_data)</pre><pre>Min. 1st Qu.  Median    Mean 3rd Qu.    Max. <br>      0     395     704    1296    1283 3356649</pre><p>Comparing difference between members:</p><pre>aggregate(total_trips_final2$ride_length ~ total_trips_final2$member_casual, FUN = mean)</pre><pre>aggregate(total_trips_final2$ride_length ~ total_trips_final2$member_casual, FUN = median)</pre><pre>aggregate(total_trips_final2$ride_length ~ total_trips_final2$member_casual, FUN = max)</pre><pre>aggregate(total_trips_final2$ride_length ~ total_trips_final2$member_casual, FUN = min)</pre><p>Checking differences between days of the week:</p><pre>aggregate(total_trips_final2$ride_length ~ total_trips_final2$member_casual +<br>            total_trips_final2$day_of_week, FUN = mean)</pre><pre>total_trips_final2 %&gt;% <br>  mutate(weekday = wday(started_at, label = TRUE)) %&gt;% <br>  group_by(member_casual, weekday) -&gt; weekday_analysis</pre><h3>Share Phase</h3><p>Bellow my main findings:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/1*yYhLns8cgmptlp7qsRuEQw.png" /></figure><p>Caual members have a higher usage time when compared to members.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*cEDuCeY0cxjO7qOhUdCmdw.png" /></figure><p>The most used bike type is the classical one. Moreover, electric bikes are widly used by casual customers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*LMXolErYfH3PY4e1Jy7jXg.png" /></figure><p>The total amount of different stations used by customers in the period is 863. Moreover, it is important to note thar 760204 trips had no data about which stations trip started. The visuaization above shows stations where trips started at least 3000 times (n = 13). The most used station is Streeter Dr &amp; Grand Ave.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*GkzX0ERnza2jatmqYcxIdw.png" /></figure><p>Later I decided to check the top starting stations for both member and casual costumers. The visualization above summarise the 12 top stations where a ride was started by both Member and Casual costumers. The most used station, Streeter Dr &amp; Grand Ave is widly used by members. Moreover, as the visualization shows, there is a considerable difference in stations used by members and costumers, and this may play a pivotal role in company business.</p><p>Then I decided to check the difference between casual and members costumers based on the ammount of rides each day of the week.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*B28feP8sCmyzF3QvZguzZg.png" /></figure><p>Members costumers tend to use Cyclist during weekdays, while casual costumers seem to use everyday, but widly during weekends. Together, this data is corroborates the higher ride length average by casual costumers.</p><p>Finally I decide to check the hours with more rides started by customer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*LMxxyAosJa4ibSJqxdnecw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*3-5ppnup-GPqGIjyHIrVDw.png" /></figure><p>Despite the numerical difference between casual and members rides, we can see a peak in rides started at 17h by members customers. Analyzed along the stations used by members and considering the usage by this customers at week days, we can infer that this customers use Cyclist to commut to work. Considering casual customers, we can see a larger peak at 13h-19h. Taking into account that casual member use Cyclist widly during weekends, it is possible to infer that casual customers use Cyclist for leisure. But, since the number of casual riders is high on week days, it is possible to think that there is also a high number of potential customers that use Cyclist to commut to work that can become members.</p><h3>Act Phase</h3><p>Considering the key points presented above, the following actions can be considered to atract more members:</p><ul><li>Offer discounts on weekends and for specific stations</li><li>Use digitla marketing strategies to target casual customers located near the most used stations by members</li><li>Start a loyalty program</li><li>Considering decrease the number of electric bikes available, since they may have a higher mantenace cost (further analysis to be done to check it.)</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f5231260ca7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>