Bike Sharing Data Visualization

Time Series Analysis of Bike Rental Patterns

This report explores the behavior of bike rental activity using time series visualization techniques.

Introduction

Data visualization is an important approach in data analysis to understand patterns, trends, and relationships within a dataset. One type of visualization commonly used when data involves a time component is time series visualization.

Time series visualization is a technique used to display how a variable changes over time. In this type of visualization, the horizontal axis typically represents time (such as days, months, or years), while the vertical axis represents the value of the observed variable. Through this visualization, analysts can identify patterns such as long-term trends, seasonal patterns, and fluctuations in the data.

The dataset used in this analysis is the Bike Sharing Dataset, which contains information about daily bike rental counts along with several related variables such as weather conditions, season, and user type. By using time series visualization, we can observe how bike rental numbers change over time and identify patterns that appear in the data.

In this analysis, three types of time series visualizations are used to understand the pattern of bike rentals over time:

  • Daily Bike Rental Trend (Line Plot). This visualization shows the total number of bike rentals for each day during the observation period. It helps identify daily fluctuations and potential upward or downward trends.

  • Monthly Average Rental Pattern (Aggregated Time Series Plot). This visualization presents the average number of bike rentals for each month. By aggregating the data monthly, we can observe potential seasonal patterns in bike usage.

  • Casual vs Registered Rental Trend (Multi-line Time Series Plot). This visualization compares the rental trends between casual users and registered users over time, allowing us to observe differences in usage patterns between these two user groups.

Data Preparation

library(tidyverse)
library(lubridate)
library(readxl)

bike <- read_excel("DATASET BIKE.xlsx")

bike$dteday <- as.Date(bike$dteday)

glimpse(bike)
## Rows: 731
## Columns: 16
## $ instant    <dbl> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, …
## $ dteday     <date> 2011-01-01, 2011-01-02, 2011-01-03, 2011-01-04, 2011-01-05…
## $ season     <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
## $ yr         <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,…
## $ mnth       <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,…
## $ holiday    <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,…
## $ weekday    <dbl> 6, 0, 1, 2, 3, 4, 5, 6, 0, 1, 2, 3, 4, 5, 6, 0, 1, 2, 3, 4,…
## $ workingday <dbl> 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1,…
## $ weathersit <dbl> 2, 2, 1, 1, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 2, 1, 2, 2, 2, 2,…
## $ temp       <dbl> 0.3441670, 0.3634780, 0.1963640, 0.2000000, 0.2269570, 0.20…
## $ atemp      <dbl> 0.3636250, 0.3537390, 0.1894050, 0.2121220, 0.2292700, 0.23…
## $ hum        <dbl> 0.805833, 0.696087, 0.437273, 0.590435, 0.436957, 0.518261,…
## $ windspeed  <dbl> 0.1604460, 0.2485390, 0.2483090, 0.1602960, 0.1869000, 0.08…
## $ casual     <dbl> 331, 131, 120, 108, 82, 88, 148, 68, 54, 41, 43, 25, 38, 54…
## $ registered <dbl> 654, 670, 1229, 1454, 1518, 1518, 1362, 891, 768, 1280, 122…
## $ cnt        <dbl> 985, 801, 1349, 1562, 1600, 1606, 1510, 959, 822, 1321, 126…

The first step is importing the dataset and ensuring that the date variable (dteday) is converted into date format so it can be used properly in time series analysis.

Daily Bike Rental Trend

This visualization uses a line chart to show the number of bike rentals over time based on daily records. The horizontal axis represents the date, while the vertical axis represents the total number of bike rentals.

Analysis Question

How does the number of bike rentals change over time on a daily basis?

The line plot above shows the changes in the number of bike rentals for each day throughout the observation period. The horizontal axis represents time in the form of dates, while the vertical axis represents the total number of bike rentals on that day.

From this visualization, it can be seen that the number of bike rentals fluctuates over time. There are periods where rentals increase significantly and other periods where they decline. In addition, there appears to be an overall tendency for rentals to increase during certain parts of the observation period.

These fluctuations may be influenced by several factors such as weather conditions, seasonal effects, weekdays versus weekends, and other social factors that affect people’s decisions to use bicycles.

Monthly Bike Rental Pattern

This visualization uses a bar chart to display the total number of bike rentals aggregated by month.

Analysis Question

Which month shows the highest and lowest bike rental activity?

The graph above shows the average number of bike rentals for each month during the observation period. The horizontal axis represents the months, while the vertical axis represents the average number of rentals for each month.

From the visualization, it can be observed that rental numbers vary across months. Some months have noticeably higher average rentals than others. This indicates the presence of a possible seasonal pattern in bike usage.

Such patterns may be influenced by environmental factors such as temperature, weather conditions, and differences in human activities across seasons.

Registered vs Casual Users

This visualization compares the number of bike rentals between registered users and casual users.

Analysis Question

How does bike rental usage differ between registered and casual users?

The line graph above shows a comparison of the number of bike rentals between casual and registered users over time. Each line on the graph represents a different user type, with the horizontal axis showing time and the vertical axis showing the number of bike rentals.

This visualization shows that the number of bike rentals by registered users is consistently higher than that of casual users. This indicates that the majority of bike rentals come from users who have registered with the bike-sharing system.

Furthermore, both lines show a relatively similar fluctuation pattern over time. When the number of rentals increases, both casual and registered users tend to experience increases simultaneously. This indicates that external factors such as seasons or weather conditions likely affect both types of users similarly.

Conclusion

Based on the time series visualizations conducted on the Bike Sharing dataset, it can be concluded that the number of bike rentals changes over time with noticeable fluctuations. The daily trend visualization shows that bike rental activity is not constant and experiences increases and decreases during certain periods.

Furthermore, the visualization of average bike rentals by month indicates the presence of seasonal patterns, where some months tend to have higher rental activity than others. This suggests that the time of the year may influence the level of bike usage.

The comparison between casual and registered users also shows that the majority of bike rentals come from registered users. However, both user types exhibit relatively similar fluctuation patterns over time, indicating that external factors such as seasonal conditions or weather may influence both types of users in a similar way.

Overall, the time series visualizations provide a clear overview of the dynamics of bike rental usage over time and help identify trends and potential seasonal patterns within the bike sharing data.