GOOGLE DATA ANALYTICS CAPSTONE
Project: How does a bike-share navigate speedy success?
CREATED BY : ABDIKHAN
ABOUT THE COMPANY
Data Analysis steps to be followed:
Ask
Prepare
Process
Analyze
Share
Act
Ask Phase
1
2
3
How do annual members and casual riders use Cyclistic bikes differently?
Why would casual riders buy Cyclistic annual memberships?
How can Cyclistic use digital media to influence casual riders to become members?
Prepare Phase
Reliability – Yes, not biased
Original – Yes can locate the original public data set.
Comprehensive – Yes, not missing important information.
Current – Yes, updated monthly.
Cited – Yes
Key Tasks:
1
I have downloaded the data from Jan22-Dec22 period.
2
Made copies of the data and stored in my Computer.
3
Compiled the data set in one folder called cyclist data under folder 2022
4
The data is in excel xlsx format
Process Phase
R WORK PLAN
1
Installing R packages
2
Loading necessary packages
3
Importing data to R studio
4
Binding data
Examining data
5
6
Removing N/A and filtering out unwanted columns
7
Adding column for ride length
8
Ggplot visualization
Exporting data in csv mode
9
Installing R packages
install.package(“tidyverse”) #for data manipulation functions like filter, mutate, read and write.
install.packages(“lubridate”) #for working with dates and time data.
install.packages(“ggplot2”) #for data visualization.
install.packages(“dplyr”) #for data manipulation like select, count, summarize group by e.t.c.
install.package(“tdyr”) #provides set of functions for working with tidy data.
1
Loading R packages
library(tidyverse)
library(lubridate)
library(ggplot2)
library(dplyr)
library(tdyr)
2
Importing data to R studio
JAN <- read_excel(“C:/Users/Windows 10 Pro/Desktop/cyclist data/2022/JAN 01.xlsx
FEB <- read_excel(“C:/Users/Windows 10 Pro/Desktop/cyclist data/2022/FEB 02.xlsx
MAR <- read_excel(“C:/Users/Windows 10 Pro/Desktop/cyclist data/2022/MAR 03.xlsx
APR <- read_excel(“C:/Users/Windows 10 Pro/Desktop/cyclist data/2022/APR 04.xlsx
MAY <- read_excel(“C:/Users/Windows 10 Pro/Desktop/cyclist data/2022/MAY 05.xlsx
JUN <- read_excel(“C:/Users/Windows 10 Pro/Desktop/cyclist data/2022/JUN 06.xlsx
JUL <- read_excel(“C:/Users/Windows 10 Pro/Desktop/cyclist data/2022/JUL 07.xlsx
AUG <- read_excel(“C:/Users/Windows 10 Pro/Desktop/cyclist data/2022/AUG 08.xlsx
SEP <- read_excel(“C:/Users/Windows 10 Pro/Desktop/cyclist data/2022/SEP 09.xlsx
OCT <- read_excel(“C:/Users/Windows 10 Pro/Desktop/cyclist data/2022/OCT 10.xlsx
NOV <- read_excel(“C:/Users/Windows 10 Pro/Desktop/cyclist data/2022/NOV 11.xlsx
DEC <- read_excel(“C:/Users/Windows 10 Pro/Desktop/cyclist data/2022/DEC 12.xlsx
BINDING DATA
RAWDATA_2022 <- rbind(“JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC”)
3
4
Examining Data
nrow(RAWDATA_2022) #number of rows.
ncol(RAWDATA_2022) #number of columns.
head(RAWDATA_2022) #shows the first six rows of the data.
tail(RAWDATA_2022) #shows the last six rows of the data.
str(RAWDATA_2022) #shows the list of columns and data types.
summary(RAWDATA_2022) #shows the statistical summary of the data.
colnames(RAWDATA_2022) #shows list of column names.
[1] "ride_id" "rideable_type" "started_at“
[4] "ended_at" "start_station_name" "start_station_id"
[7] "end_station_name" "end_station_id" "start_lat"
[10] "start_lng" "end_lat" "end_lng"
[13] "member_casual" "week_day"
5
Removing N/A and Filtering out unwanted columns
sum(is.na(RAWDATA_2022)) # to check number of N/A
RAWDATA_2022 <- na.omit(RAWDATA_2022) # to remove N/A.
RAWDATA_2022 <- RAWDATA_2022 %>%
+ select( -start_lat,-start_lng,-end_lat,-end_lng)#to remove lat and lng columns.
ADDING A COLUMN FOR RIDE LENGTH
CLEAN_DATA <- RAWDATA_2022 %>%
+mutate(ride_duration = as.numeric(difftime(ended_at,started_at, unit = “mins”)))
CLEAN_DATA <- CLEAN_DATA %>%
+filter(ride_duration > 0) # to filter out ride duration less than 0.
6
7
VISUALIZATION IN GGPLOT
ggplot(data = CLEAN_DATA,mapping= aes(x=member_casual, fill = member_casual)) +geom_bar() + labs(title=“Member Vs Casual”)
8
COUNT OF RIDES
CASUAL = 1,682,175
MEMBER = 2,471,211
TOTAL = 4,153,386
AVERAGE RIDE LENGTH
#to get average ride length in members and casual
bar <- CLEAN_DATA %>% +group_by(member_casual)%>% +summarise(avg_ride_length =mean(ride_duration))
ggplot(bar, aes(x=member_casual,y=avg_ride_length,fill=member_casual))
+geom_col()+scale_fill_manual(values=c(“purple”,”pink”))
RECOMMENDATIONS
1
To convert casual riders into members the following marketing strategies can be implemented:
Due to high demand of rides by Casuals during Summer or Weekends offer Casual or occasional membership for casual riders with discount.
2
Increase the renting prices of the bikes in Summer and weekends to target casual riders to turning members.
3
Put banners or other special discount advertisement modes to the top 10 or 20 stations were casual riders mostly visit to influence them to turn into members.