Scenario

It was founded in 2013, Bellabeat has grown rapidly and quickly positioned itself as a tech-driven wellness company for women. The company has 5 focus products: bellabeat app, leaf, time, spring and bellabeat membership. Bellabeat is a successful small company, but they have the potential to become a larger player in the global smart device market. I have been asked to analyze smart device data to gain insight into how consumers are using their smart devices. The insights we discover will then help guide marketing strategy for the company.

Ask

Buisness Task:

Analyze Fitbit data to gain insight and help guide marketing strategy for Bellabeat to grow.

Questions for Analysis:

The following three points are the questions needed to be answered by this analysis.

Key Stakeholders

Primary stakeholders: Urška Sršen and Sando Mur, executive team members.

Secondary stakeholders: Bellabeat marketing analytics team.

Prepare

The Data

The data source used for our case study is FitBit Fitness Tracker Data with 18 CSV. This dataset is stored in Kaggle and was made available through Mobius. Bellabeat Data Credibility

Only 30 user data is available. This is not an accurate representation of the entire population but meets the central limit theorem general rule of n≥30. Therefore, the sample size is sufficient for analysis.

Importing Datasets and Libraries

install.packages(“tidyverse”) library(tidyverse) install.packages(“lubridate”) library(lubridate) install.packages(“ggplot2”) library(ggplot2) install.packages(“tidyr”) library(tidyr)

install.packages(“janitor”) library(“janitor”) install.packages(“ggpubr”) library(ggpubr)

Datasets

The original data sets provided contain 18 CSV files, but I will only be using two of them: dailyActivty_Merged and sleepDay_merged. I will also be renaming the CSV files so they are easier to work with. “dailyActivity_merged has a majority of data we can use to perform the analysis: calories, total, step and the active minutes.

Import dataset dailyActivty and sleepDay and rename file to make it easier to work with.

library(readr) activity <- read_csv(“dailyActivity_merged.csv”) sleep <- read_csv(“sleepDay_merged.csv”)

head(activity) head(sleep)

Process

Let’s check our data to see if it is ready for analysis

Checking Unique ID’s

First I will check to see how many unique Ids there are in our data.

install.packages(“dplyr”) library(dplyr) n_distinct(activity\(Id) n_distinct(sleep\)Id)

Duplicates

Check for duplicates and remove them

sum(duplicated(activity)) sum(duplicated(sleep))

Here we double check that the duplicates were actually removed

sleep <-sleep %>% distinct() %>% drop_na() install.packages(“tidyr”) library(tidyr)

Indeed, they were removed

Cleaning

clean_names(activity) install.packages(“janitor”) library(janitor) clean_names(sleep)

Checking that the data was formatted correctly

str(activity) str(sleep) ### After reviewing the data, I noticed that the AcivityDate and SleepDay need to be converted into the date time format.

install.packages(“lubridate”) library(lubridate) activity <- activity %>% rename(date= ActivityDate) %>% mutate(date= as_date(date, format= “%m/%d/%Y”))

install.packages(“dplyr”) library(dplyr)

sleep <- sleep %>% rename(date= SleepDay) %>% mutate(date= as_date(date, format= “%m/%d/%Y %I:%M:%S %p”, tz= Sys.timezone()))

Analyze

Summarize and Analyze

activity %>% select(TotalSteps, TotalDistance, Calories) %>% summary()

The average steps per day for the section of “Total Steps” is 7,638 steps and the average calories burned throughout the day was 2,304. The CDC recommends an average of 10,000 steps per day but their recent studies have shown that there are still benefits if you are walking less than 10,000 steps daily. You can find the information at this website: https://archive.cdc.gov/#/details?url=https://www.cdc.gov/media/releases/2020/p0324-daily-step-count.html

sleep %>% select(TotalSleepRecords, TotalTimeInBed, TotalMinutesAsleep) %>% summary()

The users spend a rounded up average of about 7 hours of sleep and spend an average of 7.6 hours in their bed. The CDC recommends 7 or more hours on average.

The website I got my information from is listed here: https://www.cdc.gov/sleep/about_sleep/how_much_sleep.html

*Possibly having a push notification to remind users to keep calm and relax before bedtime

activity %>% select(VeryActiveMinutes, FairlyActiveMinutes, LightlyActiveMinutes, SedentaryMinutes) %>% summary()

We have 4 categories to look at for our activity levels

Very active average: 21.26 minutes Fairly active average: 13.56 minutes Lightly active minutes: 192.8 Sedentary minutes average: 991.2

Notice that our users spend a majority of their active time on “light activity” which could include things such as general housework or office work.

The majority of their day (16.5 hours) was spent in “SedentaryMinues”

*We can use push notifications to remind users to get up and be active

Merging Data

Now we merge the data for easy to understand visualizations

activity_sleep <- merge(activity, sleep, by= c(“Id”,“date”), all.x = TRUE)

Share

Total Time Asleep vs. Total Time in Bed

ggplot(data= subset(activity_sleep,!is.na(TotalMinutesAsleep)), aes(TotalSteps,TotalMinutesAsleep)) + geom_rug(position= “jitter”, size=.08) + geom_jitter() + geom_smooth() + labs(title= “Total Steps vs. Sleep Time”) + theme_minimal() install.packages(“ggplot2”) library(ggplot2)

I do not notice a real correlation between Total Steps and Sleep Time. Meaning that amount of sleep does not have any effect on activity levels for our selected users.

Total Steps and Calories

ggplot(data=activity, aes(x=TotalSteps, y=Calories)) + geom_point(color=“orange”) + geom_smooth(color=“blue”) + labs(title=“Total Steps vs. Calories”) ### The correlation between the amount of steps taken and the calories burned are very strong. ###Shown here the more active the user is the more calories you will burn. *Bellabeat can encourage users to get active trough notification during the day

Act

Here are my findings:

The average user is receiving the minimum hours of sleep per night with an additional time in bed but not asleep.

There is no correlation on how much sleep they get and how active they are. I notice that the more steps you take, the more calories you burn, even during light activity.We confirmed that a majority of users spend most of their day sedentary.

Recommendations

Being stimulated and active before bedtime can lead to unhealthy sleeping habits. To remedy this, Bellabeat can recommend users to add a bedtime routine through the app and send push notifications for bedtime reminders a couple hours or an hour before bed. This will include reminders to wind down before bed.

Bellabeat can encourage users to be more active throughout the day by sending reminders to get up and get active during their day.

Conclusion

There are many ways in which Bellabeat can help users improve their lives with daily activity. Even normal daily housework or light work can improve one’s health. The most simple way is by creating healthy habits with gentle reminders to be active or calm down and rest.