Introduction:

Bellabeat creates stylish smart devices that help women understand their health. Founded by artist Urška Sršen. Their intuitive app, alongside stylish smart devices, tracks activity, sleep, stress, and more, fueling informed choices about well-being. Now, Bellabeat wants to go deeper. By analyzing how women use their smart devices, they aim to unlock new ways to guide and inspire. This journey to understand their customers promises to fuel their marketing and keep Bellabeat at the forefront of women’s tech-driven wellness.

This case study explores into three key data sets: daily activity levels, sleep patterns, and heart rate fluctuations.

Business Task:

Analyzing smart device usage data to gain insights into consumer behavior and to guide Bellabeat’s marketing strategy.

Install and Loading Packages:

install.packages("tidyverse")
## 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)
install.packages("readxl")
## 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.4
## ✔ 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(dplyr)
library(ggplot2)
library(tidyr)
library(readxl)

Preparing and Processing The Data:

The insights presented in this case study will be derived from Fitbit fitness tracker data

I used | read.csv() | to read and create dataframes

d_activity <- read.csv("dailyActivity_merged.csv")
d_sleep <- read.csv("sleepDay_merged.csv")
heart_rate_seconds <- read.csv("heartrate_seconds_merged.csv")

Then, I corrected the time and date in the data using | as.Date | & | as.POSIXct | , checked for NA values | summary(is.na()) | which I didnt find any none available data.

Now to check and view each dataframe , I used | str() | & | glimpse() |

str(d_activity)
## 'data.frame':    940 obs. of  15 variables:
##  $ Id                      : num  1.5e+09 1.5e+09 1.5e+09 1.5e+09 1.5e+09 ...
##  $ ActivityDate            : chr  "4/12/2016" "4/13/2016" "4/14/2016" "4/15/2016" ...
##  $ TotalSteps              : int  13162 10735 10460 9762 12669 9705 13019 15506 10544 9819 ...
##  $ TotalDistance           : num  8.5 6.97 6.74 6.28 8.16 ...
##  $ TrackerDistance         : num  8.5 6.97 6.74 6.28 8.16 ...
##  $ LoggedActivitiesDistance: num  0 0 0 0 0 0 0 0 0 0 ...
##  $ VeryActiveDistance      : num  1.88 1.57 2.44 2.14 2.71 ...
##  $ ModeratelyActiveDistance: num  0.55 0.69 0.4 1.26 0.41 ...
##  $ LightActiveDistance     : num  6.06 4.71 3.91 2.83 5.04 ...
##  $ SedentaryActiveDistance : num  0 0 0 0 0 0 0 0 0 0 ...
##  $ VeryActiveMinutes       : int  25 21 30 29 36 38 42 50 28 19 ...
##  $ FairlyActiveMinutes     : int  13 19 11 34 10 20 16 31 12 8 ...
##  $ LightlyActiveMinutes    : int  328 217 181 209 221 164 233 264 205 211 ...
##  $ SedentaryMinutes        : int  728 776 1218 726 773 539 1149 775 818 838 ...
##  $ Calories                : int  1985 1797 1776 1745 1863 1728 1921 2035 1786 1775 ...
str(d_sleep)
## 'data.frame':    413 obs. of  5 variables:
##  $ Id                : num  1.5e+09 1.5e+09 1.5e+09 1.5e+09 1.5e+09 ...
##  $ SleepDay          : chr  "4/12/2016 12:00:00 AM" "4/13/2016 12:00:00 AM" "4/15/2016 12:00:00 AM" "4/16/2016 12:00:00 AM" ...
##  $ TotalSleepRecords : int  1 2 1 2 1 1 1 1 1 1 ...
##  $ TotalMinutesAsleep: int  327 384 412 340 700 304 360 325 361 430 ...
##  $ TotalTimeInBed    : int  346 407 442 367 712 320 377 364 384 449 ...
str(heart_rate_seconds)
## 'data.frame':    2483658 obs. of  3 variables:
##  $ Id   : num  2.02e+09 2.02e+09 2.02e+09 2.02e+09 2.02e+09 ...
##  $ Time : chr  "4/12/2016 7:21:00 AM" "4/12/2016 7:21:05 AM" "4/12/2016 7:21:10 AM" "4/12/2016 7:21:20 AM" ...
##  $ Value: int  97 102 105 103 101 95 91 93 94 93 ...
glimpse(d_activity)
## Rows: 940
## Columns: 15
## $ Id                       <dbl> 1503960366, 1503960366, 1503960366, 150396036…
## $ ActivityDate             <chr> "4/12/2016", "4/13/2016", "4/14/2016", "4/15/…
## $ TotalSteps               <int> 13162, 10735, 10460, 9762, 12669, 9705, 13019…
## $ TotalDistance            <dbl> 8.50, 6.97, 6.74, 6.28, 8.16, 6.48, 8.59, 9.8…
## $ TrackerDistance          <dbl> 8.50, 6.97, 6.74, 6.28, 8.16, 6.48, 8.59, 9.8…
## $ LoggedActivitiesDistance <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ VeryActiveDistance       <dbl> 1.88, 1.57, 2.44, 2.14, 2.71, 3.19, 3.25, 3.5…
## $ ModeratelyActiveDistance <dbl> 0.55, 0.69, 0.40, 1.26, 0.41, 0.78, 0.64, 1.3…
## $ LightActiveDistance      <dbl> 6.06, 4.71, 3.91, 2.83, 5.04, 2.51, 4.71, 5.0…
## $ SedentaryActiveDistance  <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
## $ VeryActiveMinutes        <int> 25, 21, 30, 29, 36, 38, 42, 50, 28, 19, 66, 4…
## $ FairlyActiveMinutes      <int> 13, 19, 11, 34, 10, 20, 16, 31, 12, 8, 27, 21…
## $ LightlyActiveMinutes     <int> 328, 217, 181, 209, 221, 164, 233, 264, 205, …
## $ SedentaryMinutes         <int> 728, 776, 1218, 726, 773, 539, 1149, 775, 818…
## $ Calories                 <int> 1985, 1797, 1776, 1745, 1863, 1728, 1921, 203…
glimpse(d_sleep)
## Rows: 413
## Columns: 5
## $ Id                 <dbl> 1503960366, 1503960366, 1503960366, 1503960366, 150…
## $ SleepDay           <chr> "4/12/2016 12:00:00 AM", "4/13/2016 12:00:00 AM", "…
## $ TotalSleepRecords  <int> 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …
## $ TotalMinutesAsleep <int> 327, 384, 412, 340, 700, 304, 360, 325, 361, 430, 2…
## $ TotalTimeInBed     <int> 346, 407, 442, 367, 712, 320, 377, 364, 384, 449, 3…
glimpse(heart_rate_seconds)
## Rows: 2,483,658
## Columns: 3
## $ Id    <dbl> 2022484408, 2022484408, 2022484408, 2022484408, 2022484408, 2022…
## $ Time  <chr> "4/12/2016 7:21:00 AM", "4/12/2016 7:21:05 AM", "4/12/2016 7:21:…
## $ Value <int> 97, 102, 105, 103, 101, 95, 91, 93, 94, 93, 92, 89, 83, 61, 60, …

I noticed that all dataframes have the ‘Id’ column, so I used the function | n_distinct() | to understand how many individual participants in each dataset

n_distinct(d_activity$Id)
## [1] 33
n_distinct(d_sleep$Id)
## [1] 24
n_distinct(heart_rate_seconds$Id)
## [1] 14

In the (d_activity) data there are 33 participants, the (d_sleep) data 24 participants, and the (heart_rate_seconds) date 14 participants.

The lower number of participations in the heart_rate_seconds dataframe, could be due to factors such as technical limitations, user consent, or device-specific data collection. It’s possible that not all users consented to or had devices capable of providing heart rate data at such a granular level, leading to a smaller number of participants in this dataframe compared to the others.

For the d_sleep datasframe, it could be due to factors such as user engagement with sleep tracking, device-specific capabilities, or user consent. Not all users may have consistently used sleep tracking features, leading to a smaller number of participants in this dataframe compared to the “d_activity” dataset.

Analyzing The Data:

1

I wanted to find the total activity duration, so I calculated it by summing the minutes spent in different activity levels. Then I made a scatter plot to show the relation between Steps, Calories, and Activity Duration.

The scatter plot reveals a clear positive correlation between activity duration and total steps taken, ultimately leading to increased calorie burn. As activity duration extends, the total steps range widens, indicating a greater variation in individual responses. For example, at 500 minutes of activity, total steps can range anywhere from 10,000 to 30,000, while at 30,000 minutes, steps can still reach up to 20,000. This data underscores the principle that higher levels of physical activity, as measured by both increased steps and longer durations, consistently translate to greater calorie expenditure.

2

The scatter plot paints a clear picture of the positive association between sleep duration and the number of sleep records. As the number of recorded sleep periods increases, the overall sleep duration tends to climb as well. In simpler terms, individuals who fragment their sleep into multiple records generally accumulate more sleep time compared to those with fewer, longer stretches of slumber.

3

This bar chart reveals the intriguing fluctuations in average heart rate throughout the day. As shown, the early morning hours from 5 AM to 10 AM paint a picture of tranquility, with relatively low heart rates, hinting at a restful slumber or quiet repose.

However, around 15 PM to 20 PM, the pulse of the day quickens. We observe a noticeable upswing in the average heart rate, which could be attributed to a surge in activity levels, a touch of midday stress, or perhaps both.

Picture taken by: Florian Kurrasch

Ideas For The Bellabeat App:

  • Bellabeat could recommend personalized activity goals, sleep routines, and stress management techniques based on individual data patterns. Users would feel their needs truly understood and receive actionable guidance for each aspect of their well-being.
  • By incorporating gamification elements, progress tracking, and even virtual coaching features, Bellabeat could turn achieving health goals into a fun and engaging experience. * Build a thriving community within Bellabeat. Create a safe space for users to connect, share experiences, and support each other on their wellness journeys. This peer-to-peer motivation could further empower users to reach their goals.
  • Actionable recommendations like “Aim for 7500 steps today” or “Practice deep breathing before bed”, would make taking the next step towards better health effortless.
  • Smart and timely nudges. Imagine Bellabeat suggesting a midday walk based on individual peak heart rate hours. These contextual reminders would seamlessly integrate healthy habits into users’ daily routines.

Business Recommendations and Insights:

1.Holistic focus: Bellabeat can move beyond individual metrics and embrace a holistic approach to well-being. By integrating data from different sensors and providing insights that connect activity, sleep, and stress, Bellabeat could offer a truly comprehensive picture of health. 2.Emotional well-being: Recognizing the importance of mental health is key. Bellabeat could offer mindfulness resources, stress management tools, and sleep hygiene tips, empowering users to care for their emotional well-being alongside physical health.

Conclusion:

By analyzing user data and implementing the suggested app features and recommendations, Bellabeat can position itself as a leader in women’s tech-driven wellness. By promoting a holistic approach to well-being, focusing on emotional health, and building trust through data privacy, Bellabeat can empower women to make informed choices about their health and live more fulfilling lives.

I am grateful for your interest in my work on Bellabeat. I hope you found the case study informative and valuable! This is my first case study, and first project using R Language, your review is greatly appreciated. Please feel free to reach out if you have any questions or feedback.