Cyclistic introduced a successful bike-sharing programme in 2016. Since then, the initiative has expanded to include 5,824 bicycles that are locked and tracked into a system of 692 stations located throughout Chicago. The bikes can be unlocked at any station and then returned at any time to any other station in the network.
Previously, Cyclistic’s marketing strategy relied on raising general awareness and appealing to a wide range of consumer segments.One approach that helped make these things possible was the flexibility of its pricing plans, which included single-ride passes, full-day passes, and annual membership.Customers who purchase single-ride or full-day passes are referred to as casual riders. Customers who purchase annual memberships are Cyclistic members.
Cyclistic’s financial analysts determined that annual members are far more profitable than casual riders.Cyclistic’s pricing flexibility attracts more customers, but Moreno emphasises the importance of increasing annual memberships for future growth. Moreno sees potential in converting casual riders into annual members, rather than focusing solely on acquiring new customers.Casual riders are already familiar with the Cycling programme and have chosen it to meet their mobility needs.Moreno has a clear goal: to develop marketing strategies aimed at converting casual riders to annual members.
Cycles, such as bikes, are still an important mode of transportation for many people today. It is obvious to investigate how annual and casual members differ from one another. Analyzing past bike trips could lead to identifying major trends regarding the conversion of casual members to annual members for the growth of the Cyclistic’s future.
1.How do annual members and casual riders use Cyclistic bikes differently?
2.Why would casual riders buy Cyclistic annual memberships?
3.How can Cyclistic use digital media to influence casual riders to become members?
The data we will be using for analysis in this case study is available online in form of zip files. The datasets has been made available by Motivate International Inc. This datasets are owned by the city of Chicago which includes rights,title and interest in data.Nothing in this Agreement is or implies a waiver of any rights Bikeshare or the City of Chicago has in the Data or in any copyrights, patents, or trademarks owned or licensed by Bikeshare, its parent, affiliates or sponsors. The DIVVY trademarks are owned by the City of Chicago.
Since most of the datasets are not that accurate, so we will be using three of those available datasets in our case study. However, the data are not that old and had a long data collecting time frame of a year. It’s nice to have a longer data-collecting time frame which helps us to understand the users of bikes and also aids in “Cyclistic Bike-Share” future growth.
Due to data-privacy issue this data has certain limitations.
All the datasets are long, which has many rows and few columns. So we will be using RStudio for our case study as it helps with multiple packages and data viz option available to accomplish the goal.
install.packages("tidyverse")
## Installing package into '/cloud/lib/x86_64-pc-linux-gnu-library/4.3'
## (as 'lib' is unspecified)
install.packages("lubridate")
## Installing package into '/cloud/lib/x86_64-pc-linux-gnu-library/4.3'
## (as 'lib' is unspecified)
install.packages("ggplot2")
## Installing package into '/cloud/lib/x86_64-pc-linux-gnu-library/4.3'
## (as 'lib' is unspecified)
install.packages("dplyr")
## Installing package into '/cloud/lib/x86_64-pc-linux-gnu-library/4.3'
## (as 'lib' is unspecified)
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.4 ✔ readr 2.1.5
## ✔ forcats 1.0.0 ✔ stringr 1.5.1
## ✔ ggplot2 3.4.4 ✔ tibble 3.2.1
## ✔ lubridate 1.9.3 ✔ tidyr 1.3.0
## ✔ purrr 1.0.2
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(lubridate)
library(ggplot2)
library(dplyr)
library(geosphere)
library(readr)
library(janitor)
##
## Attaching package: 'janitor'
##
## The following objects are masked from 'package:stats':
##
## chisq.test, fisher.test
feb_2022 <- read.csv("202201-divvy-tripdata.csv")
mar_2022 <- read.csv("202202-divvy-tripdata.csv")
apr_2022 <- read.csv("202203-divvy-tripdata.csv")
bike_info <- bind_rows(feb_2022,mar_2022,apr_2022)
head(bike_info)
## ride_id rideable_type started_at ended_at
## 1 C2F7DD78E82EC875 electric_bike 2022-01-13 11:59:47 2022-01-13 12:02:44
## 2 A6CF8980A652D272 electric_bike 2022-01-10 08:41:56 2022-01-10 08:46:17
## 3 BD0F91DFF741C66D classic_bike 2022-01-25 04:53:40 2022-01-25 04:58:01
## 4 CBB80ED419105406 classic_bike 2022-01-04 00:18:04 2022-01-04 00:33:00
## 5 DDC963BFDDA51EEA classic_bike 2022-01-20 01:31:10 2022-01-20 01:37:12
## 6 A39C6F6CC0586C0B classic_bike 2022-01-11 18:48:09 2022-01-11 18:51:31
## start_station_name start_station_id end_station_name
## 1 Glenwood Ave & Touhy Ave 525 Clark St & Touhy Ave
## 2 Glenwood Ave & Touhy Ave 525 Clark St & Touhy Ave
## 3 Sheffield Ave & Fullerton Ave TA1306000016 Greenview Ave & Fullerton Ave
## 4 Clark St & Bryn Mawr Ave KA1504000151 Paulina St & Montrose Ave
## 5 Michigan Ave & Jackson Blvd TA1309000002 State St & Randolph St
## 6 Wood St & Chicago Ave 637 Honore St & Division St
## end_station_id start_lat start_lng end_lat end_lng member_casual
## 1 RP-007 42.01280 -87.66591 42.01256 -87.67437 casual
## 2 RP-007 42.01276 -87.66597 42.01256 -87.67437 casual
## 3 TA1307000001 41.92560 -87.65371 41.92533 -87.66580 member
## 4 TA1309000021 41.98359 -87.66915 41.96151 -87.67139 casual
## 5 TA1305000029 41.87785 -87.62408 41.88462 -87.62783 member
## 6 TA1305000034 41.89563 -87.67207 41.90312 -87.67394 member
summary(bike_info)
## ride_id rideable_type started_at ended_at
## Length:503421 Length:503421 Length:503421 Length:503421
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
##
## start_station_name start_station_id end_station_name end_station_id
## Length:503421 Length:503421 Length:503421 Length:503421
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
##
## start_lat start_lng end_lat end_lng
## Min. :41.65 Min. :-87.84 Min. :41.64 Min. :-87.84
## 1st Qu.:41.88 1st Qu.:-87.66 1st Qu.:41.88 1st Qu.:-87.66
## Median :41.89 Median :-87.64 Median :41.89 Median :-87.64
## Mean :41.90 Mean :-87.65 Mean :41.90 Mean :-87.65
## 3rd Qu.:41.93 3rd Qu.:-87.63 3rd Qu.:41.93 3rd Qu.:-87.63
## Max. :45.64 Max. :-73.80 Max. :42.07 Max. :-87.51
## NA's :429 NA's :429
## member_casual
## Length:503421
## Class :character
## Mode :character
##
##
##
##
bike_info$date <- as.Date(bike_info$started_at)
bike_info$month <- format(as.Date(bike_info$date),"%m")
bike_info$year <- format(as.Date(bike_info$date),"%y")
bike_info$day <- format(as.Date(bike_info$date),"%d")
bike_info$weekday <- format(as.Date(bike_info$date),"%A")
head(bike_info) # review all the column name
## ride_id rideable_type started_at ended_at
## 1 C2F7DD78E82EC875 electric_bike 2022-01-13 11:59:47 2022-01-13 12:02:44
## 2 A6CF8980A652D272 electric_bike 2022-01-10 08:41:56 2022-01-10 08:46:17
## 3 BD0F91DFF741C66D classic_bike 2022-01-25 04:53:40 2022-01-25 04:58:01
## 4 CBB80ED419105406 classic_bike 2022-01-04 00:18:04 2022-01-04 00:33:00
## 5 DDC963BFDDA51EEA classic_bike 2022-01-20 01:31:10 2022-01-20 01:37:12
## 6 A39C6F6CC0586C0B classic_bike 2022-01-11 18:48:09 2022-01-11 18:51:31
## start_station_name start_station_id end_station_name
## 1 Glenwood Ave & Touhy Ave 525 Clark St & Touhy Ave
## 2 Glenwood Ave & Touhy Ave 525 Clark St & Touhy Ave
## 3 Sheffield Ave & Fullerton Ave TA1306000016 Greenview Ave & Fullerton Ave
## 4 Clark St & Bryn Mawr Ave KA1504000151 Paulina St & Montrose Ave
## 5 Michigan Ave & Jackson Blvd TA1309000002 State St & Randolph St
## 6 Wood St & Chicago Ave 637 Honore St & Division St
## end_station_id start_lat start_lng end_lat end_lng member_casual
## 1 RP-007 42.01280 -87.66591 42.01256 -87.67437 casual
## 2 RP-007 42.01276 -87.66597 42.01256 -87.67437 casual
## 3 TA1307000001 41.92560 -87.65371 41.92533 -87.66580 member
## 4 TA1309000021 41.98359 -87.66915 41.96151 -87.67139 casual
## 5 TA1305000029 41.87785 -87.62408 41.88462 -87.62783 member
## 6 TA1305000034 41.89563 -87.67207 41.90312 -87.67394 member
## date month year day weekday
## 1 2022-01-13 01 22 13 Thursday
## 2 2022-01-10 01 22 10 Monday
## 3 2022-01-25 01 22 25 Tuesday
## 4 2022-01-04 01 22 04 Tuesday
## 5 2022-01-20 01 22 20 Thursday
## 6 2022-01-11 01 22 11 Tuesday
bike_info$length_of_ride <- difftime(bike_info$ended_at,bike_info$started_at)
str(bike_info)
## 'data.frame': 503421 obs. of 19 variables:
## $ ride_id : chr "C2F7DD78E82EC875" "A6CF8980A652D272" "BD0F91DFF741C66D" "CBB80ED419105406" ...
## $ rideable_type : chr "electric_bike" "electric_bike" "classic_bike" "classic_bike" ...
## $ started_at : chr "2022-01-13 11:59:47" "2022-01-10 08:41:56" "2022-01-25 04:53:40" "2022-01-04 00:18:04" ...
## $ ended_at : chr "2022-01-13 12:02:44" "2022-01-10 08:46:17" "2022-01-25 04:58:01" "2022-01-04 00:33:00" ...
## $ start_station_name: chr "Glenwood Ave & Touhy Ave" "Glenwood Ave & Touhy Ave" "Sheffield Ave & Fullerton Ave" "Clark St & Bryn Mawr Ave" ...
## $ start_station_id : chr "525" "525" "TA1306000016" "KA1504000151" ...
## $ end_station_name : chr "Clark St & Touhy Ave" "Clark St & Touhy Ave" "Greenview Ave & Fullerton Ave" "Paulina St & Montrose Ave" ...
## $ end_station_id : chr "RP-007" "RP-007" "TA1307000001" "TA1309000021" ...
## $ start_lat : num 42 42 41.9 42 41.9 ...
## $ start_lng : num -87.7 -87.7 -87.7 -87.7 -87.6 ...
## $ end_lat : num 42 42 41.9 42 41.9 ...
## $ end_lng : num -87.7 -87.7 -87.7 -87.7 -87.6 ...
## $ member_casual : chr "casual" "casual" "member" "casual" ...
## $ date : Date, format: "2022-01-13" "2022-01-10" ...
## $ month : chr "01" "01" "01" "01" ...
## $ year : chr "22" "22" "22" "22" ...
## $ day : chr "13" "10" "25" "04" ...
## $ weekday : chr "Thursday" "Monday" "Tuesday" "Tuesday" ...
## $ length_of_ride : 'difftime' num 177 261 261 896 ...
## ..- attr(*, "units")= chr "secs"
bike_info$length_of_ride <- as.numeric(as.character(bike_info$length_of_ride))
bike_info$distance_ride <- distGeo(matrix(c(bike_info$start_lng,bike_info$start_lat), ncol = 2), matrix(c(bike_info$end_lng,bike_info$end_lat), ncol = 2))
bike_info$distance_ride <- bike_info$distance_ride/1000
trip_data_clean <- bike_info[!(bike_info$length_of_ride <= 0),]
glimpse(trip_data_clean)
## Rows: 503,393
## Columns: 20
## $ ride_id <chr> "C2F7DD78E82EC875", "A6CF8980A652D272", "BD0F91DFF7…
## $ rideable_type <chr> "electric_bike", "electric_bike", "classic_bike", "…
## $ started_at <chr> "2022-01-13 11:59:47", "2022-01-10 08:41:56", "2022…
## $ ended_at <chr> "2022-01-13 12:02:44", "2022-01-10 08:46:17", "2022…
## $ start_station_name <chr> "Glenwood Ave & Touhy Ave", "Glenwood Ave & Touhy A…
## $ start_station_id <chr> "525", "525", "TA1306000016", "KA1504000151", "TA13…
## $ end_station_name <chr> "Clark St & Touhy Ave", "Clark St & Touhy Ave", "Gr…
## $ end_station_id <chr> "RP-007", "RP-007", "TA1307000001", "TA1309000021",…
## $ start_lat <dbl> 42.01280, 42.01276, 41.92560, 41.98359, 41.87785, 4…
## $ start_lng <dbl> -87.66591, -87.66597, -87.65371, -87.66915, -87.624…
## $ end_lat <dbl> 42.01256, 42.01256, 41.92533, 41.96151, 41.88462, 4…
## $ end_lng <dbl> -87.67437, -87.67437, -87.66580, -87.67139, -87.627…
## $ member_casual <chr> "casual", "casual", "member", "casual", "member", "…
## $ date <date> 2022-01-13, 2022-01-10, 2022-01-25, 2022-01-04, 20…
## $ month <chr> "01", "01", "01", "01", "01", "01", "01", "01", "01…
## $ year <chr> "22", "22", "22", "22", "22", "22", "22", "22", "22…
## $ day <chr> "13", "10", "25", "04", "20", "11", "30", "22", "17…
## $ weekday <chr> "Thursday", "Monday", "Tuesday", "Tuesday", "Thursd…
## $ length_of_ride <dbl> 177, 261, 261, 896, 362, 202, 994, 724, 1527, 443, …
## $ distance_ride <dbl> 0.7013791, 0.6961414, 1.0034507, 2.4601250, 0.81407…
str(trip_data_clean) #first lets check the structure of the data frame
## 'data.frame': 503393 obs. of 20 variables:
## $ ride_id : chr "C2F7DD78E82EC875" "A6CF8980A652D272" "BD0F91DFF741C66D" "CBB80ED419105406" ...
## $ rideable_type : chr "electric_bike" "electric_bike" "classic_bike" "classic_bike" ...
## $ started_at : chr "2022-01-13 11:59:47" "2022-01-10 08:41:56" "2022-01-25 04:53:40" "2022-01-04 00:18:04" ...
## $ ended_at : chr "2022-01-13 12:02:44" "2022-01-10 08:46:17" "2022-01-25 04:58:01" "2022-01-04 00:33:00" ...
## $ start_station_name: chr "Glenwood Ave & Touhy Ave" "Glenwood Ave & Touhy Ave" "Sheffield Ave & Fullerton Ave" "Clark St & Bryn Mawr Ave" ...
## $ start_station_id : chr "525" "525" "TA1306000016" "KA1504000151" ...
## $ end_station_name : chr "Clark St & Touhy Ave" "Clark St & Touhy Ave" "Greenview Ave & Fullerton Ave" "Paulina St & Montrose Ave" ...
## $ end_station_id : chr "RP-007" "RP-007" "TA1307000001" "TA1309000021" ...
## $ start_lat : num 42 42 41.9 42 41.9 ...
## $ start_lng : num -87.7 -87.7 -87.7 -87.7 -87.6 ...
## $ end_lat : num 42 42 41.9 42 41.9 ...
## $ end_lng : num -87.7 -87.7 -87.7 -87.7 -87.6 ...
## $ member_casual : chr "casual" "casual" "member" "casual" ...
## $ date : Date, format: "2022-01-13" "2022-01-10" ...
## $ month : chr "01" "01" "01" "01" ...
## $ year : chr "22" "22" "22" "22" ...
## $ day : chr "13" "10" "25" "04" ...
## $ weekday : chr "Thursday" "Monday" "Tuesday" "Tuesday" ...
## $ length_of_ride : num 177 261 261 896 362 ...
## $ distance_ride : num 0.701 0.696 1.003 2.46 0.814 ...
summary(trip_data_clean)
## ride_id rideable_type started_at ended_at
## Length:503393 Length:503393 Length:503393 Length:503393
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
##
## start_station_name start_station_id end_station_name end_station_id
## Length:503393 Length:503393 Length:503393 Length:503393
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
##
## start_lat start_lng end_lat end_lng
## Min. :41.65 Min. :-87.84 Min. :41.64 Min. :-87.84
## 1st Qu.:41.88 1st Qu.:-87.66 1st Qu.:41.88 1st Qu.:-87.66
## Median :41.89 Median :-87.64 Median :41.89 Median :-87.64
## Mean :41.90 Mean :-87.65 Mean :41.90 Mean :-87.65
## 3rd Qu.:41.93 3rd Qu.:-87.63 3rd Qu.:41.93 3rd Qu.:-87.63
## Max. :45.64 Max. :-73.80 Max. :42.07 Max. :-87.51
## NA's :429 NA's :429
## member_casual date month year
## Length:503393 Min. :2022-01-01 Length:503393 Length:503393
## Class :character 1st Qu.:2022-02-08 Class :character Class :character
## Mode :character Median :2022-03-04 Mode :character Mode :character
## Mean :2022-02-25
## 3rd Qu.:2022-03-17
## Max. :2022-03-31
##
## day weekday length_of_ride distance_ride
## Length:503393 Length:503393 Min. : 1 Min. : 0.0000
## Class :character Class :character 1st Qu.: 306 1st Qu.: 0.8292
## Mode :character Mode :character Median : 525 Median : 1.3865
## Mean : 1011 Mean : 1.9374
## 3rd Qu.: 946 3rd Qu.: 2.4683
## Max. :2061244 Max. :1192.2456
## NA's :429
trip_data_clean %>%
group_by(member_casual) %>%
summarise(average_ride_length = mean(length_of_ride), median_length = median(length_of_ride),
max_ride_length = max(length_of_ride), min_ride_length = min(length_of_ride))
## # A tibble: 2 × 5
## member_casual average_ride_length median_length max_ride_length
## <chr> <dbl> <dbl> <dbl>
## 1 casual 1880. 774 2061244
## 2 member 709. 466 93594
## # ℹ 1 more variable: min_ride_length <dbl>
trip_data_clean %>%
group_by(member_casual) %>%
summarise(ride_count=length(ride_id),Percentage=n()/nrow(trip_data_clean)*100)
## # A tibble: 2 × 3
## member_casual ride_count Percentage
## <chr> <int> <dbl>
## 1 casual 129805 25.8
## 2 member 373588 74.2
trip_data_clean$weekday <- ordered(trip_data_clean$weekday,
levels=c("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"))
trip_data_clean %>%
group_by(member_casual, weekday) %>% #groups by member_casual
summarise(number_of_rides = n() #calculates the number of rides and average duration
,average_ride_length = mean(length_of_ride),.groups="drop") %>% # calculates the average duration
arrange(member_casual, weekday)%>%
ggplot(aes(x = weekday, y = number_of_rides, fill = member_casual)) +
labs(title ="Total rides of Members and Casual riders Vs. Day of the week") +
geom_col(width=0.5, position = position_dodge(width=0.5)) +
scale_y_continuous(labels = function(x) format(x, scientific = FALSE))
trip_data_clean %>%
group_by(member_casual, weekday) %>%
summarise(average_ride_length = mean(length_of_ride), .groups="drop") %>%
ggplot(aes(x = weekday, y = average_ride_length, fill = member_casual)) +
geom_col(width=0.5, position = position_dodge(width=0.5)) +
labs(title ="Average ride time of Members and Casual riders Vs. Day of the week")
In the ACT phase the decision would be taken by excutive team, marketing analytics team and Director of marketing on the basis of my data-driven decision making.
Always appreciate your valuable insights and thanks for reading my case study.