INTRODUCTION

This case study was made as a final project for the Google Data Analytics Certificate. by analyzing FitBit Fitness Tracker Data to make useful insights for Bellabeat.

following the data life cycle steps in this case study :

  • ASK
  • Prepare
  • Process
  • Analyze
  • Share
  • Act

1) ASK

Background

Bellabeat is a high-tech manufacturer of beautifully-designed health-focused smart products for women since 2013.Bellabeat has grown rapidly and quickly positioned itself as a tech-driven wellness company for females.

The co-founder and Chief Creative Officer, Urška Sršen is confident that an analysis of non-Bellebeat consumer data (ie. FitBit fitness tracker usage data) would reveal more opportunities for growth.

Business Task:

  • Analyze FitBit fitness tracker data to gain insights into how consumers are using the FitBit app.
  • discover trends for Bellabeat marketing strategy.

Objectives:

  1. What are some trends in smart device usage?
  1. How could these trends apply to Bellabeat customers?
  1. How could these trends help influence Bellabeat marketing strategy?

key stakeholders:

  1. Urška Sršen (Bellabeat’s cofounder and Chief Creative Officer).

  2. Sando Mur (Mathematician and Bellabeat’s cofounder).

  3. Bellabeat marketing analytics team.

2) Prepare

Data Source:

  • Data is publicly available on Kaggle: FitBit Fitness Tracker Data.
  • stored in 18 csv files.
  • Generated by respondents from a survey via Amazon Mechanical Turk.
  • The data is close to 5 years old (12 March 2016 to 12 May 2016).
  • 30 FitBit users consented to the submission of personal tracker data.

Checking the data credibility with ROCCC :

(Reliable, Original, Comprehensive, Current, and Cited)

Classification by : (Low -> Medium -> High)

ROCCC Characteristic Classification Comment
Reliable LOW Not reliable as it only has 30 respondents.
Original LOW Third party provider.
Comprehensive MED Parameters match most of Bellabeat products’ parameters.
Current LOW Data is 5 years old and may not be relevant.
Cited LOW Data collected from third party, hence unknown.

Final assessment of the data source:

the dataset is considered bad quality data and not recommended for analysis and to produce business recommendations based on this data.

Tool:

We are using Rstudio for data cleaning, transformation and visualization.

3) Process

The Data Must be cleaned for analysis.

Cleaning Steps:

  • Install R packages and Observe the data.
  • Remove duplicate values
  • Remove empty rows

Installing cleaning packages, Loading libraries for processing and analyzing data

library(tidyverse)
## -- Attaching packages --------------------------------------- tidyverse 1.3.1 --
## v ggplot2 3.3.5     v purrr   0.3.4
## v tibble  3.1.6     v dplyr   1.0.7
## v tidyr   1.1.4     v stringr 1.4.0
## v readr   2.1.1     v forcats 0.5.1
## -- Conflicts ------------------------------------------ tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag()    masks stats::lag()
library(readxl)
library(lubridate)
## 
## Attaching package: 'lubridate'
## The following objects are masked from 'package:base':
## 
##     date, intersect, setdiff, union

Importing Data

dailyActivity_merged <- read_csv("Fitabase Data 4.12.16-5.12.16/dailyActivity_merged.csv")
## Rows: 940 Columns: 15
## -- Column specification --------------------------------------------------------
## Delimiter: ","
## chr  (1): ActivityDate
## dbl (14): Id, TotalSteps, TotalDistance, TrackerDistance, LoggedActivitiesDi...
## 
## i Use `spec()` to retrieve the full column specification for this data.
## i Specify the column types or set `show_col_types = FALSE` to quiet this message.
dailyCalories_merged <- read_csv("Fitabase Data 4.12.16-5.12.16/dailyCalories_merged.csv")
## Rows: 940 Columns: 3
## -- Column specification --------------------------------------------------------
## Delimiter: ","
## chr (1): ActivityDay
## dbl (2): Id, Calories
## 
## i Use `spec()` to retrieve the full column specification for this data.
## i Specify the column types or set `show_col_types = FALSE` to quiet this message.
dailyIntensities_merged <- read_csv("Fitabase Data 4.12.16-5.12.16/dailyIntensities_merged.csv")
## Rows: 940 Columns: 10
## -- Column specification --------------------------------------------------------
## Delimiter: ","
## chr (1): ActivityDay
## dbl (9): Id, SedentaryMinutes, LightlyActiveMinutes, FairlyActiveMinutes, Ve...
## 
## i Use `spec()` to retrieve the full column specification for this data.
## i Specify the column types or set `show_col_types = FALSE` to quiet this message.
sleepDay_merged <- read_csv("Fitabase Data 4.12.16-5.12.16/sleepDay_merged.csv")
## Rows: 413 Columns: 5
## -- Column specification --------------------------------------------------------
## Delimiter: ","
## chr (1): SleepDay
## dbl (4): Id, TotalSleepRecords, TotalMinutesAsleep, TotalTimeInBed
## 
## i Use `spec()` to retrieve the full column specification for this data.
## i Specify the column types or set `show_col_types = FALSE` to quiet this message.
weightLogInfo_merged <- read_csv("Fitabase Data 4.12.16-5.12.16/weightLogInfo_merged.csv")
## Rows: 67 Columns: 8
## -- Column specification --------------------------------------------------------
## Delimiter: ","
## chr (1): Date
## dbl (6): Id, WeightKg, WeightPounds, Fat, BMI, LogId
## lgl (1): IsManualReport
## 
## i Use `spec()` to retrieve the full column specification for this data.
## i Specify the column types or set `show_col_types = FALSE` to quiet this message.

Over viewing and Getting Familiar with datasets:

daily_activity <- dailyActivity_merged
daily_calories <- dailyCalories_merged
daily_intensities <- dailyIntensities_merged
sleep_day <- sleepDay_merged
weight_log <- weightLogInfo_merged

head(daily_activity)
## # A tibble: 6 x 15
##        Id ActivityDate TotalSteps TotalDistance TrackerDistance LoggedActivitie~
##     <dbl> <chr>             <dbl>         <dbl>           <dbl>            <dbl>
## 1  1.50e9 4/12/2016         13162          8.5             8.5                 0
## 2  1.50e9 4/13/2016         10735          6.97            6.97                0
## 3  1.50e9 4/14/2016         10460          6.74            6.74                0
## 4  1.50e9 4/15/2016          9762          6.28            6.28                0
## 5  1.50e9 4/16/2016         12669          8.16            8.16                0
## 6  1.50e9 4/17/2016          9705          6.48            6.48                0
## # ... with 9 more variables: VeryActiveDistance <dbl>,
## #   ModeratelyActiveDistance <dbl>, LightActiveDistance <dbl>,
## #   SedentaryActiveDistance <dbl>, VeryActiveMinutes <dbl>,
## #   FairlyActiveMinutes <dbl>, LightlyActiveMinutes <dbl>,
## #   SedentaryMinutes <dbl>, Calories <dbl>
colnames(daily_activity)
##  [1] "Id"                       "ActivityDate"            
##  [3] "TotalSteps"               "TotalDistance"           
##  [5] "TrackerDistance"          "LoggedActivitiesDistance"
##  [7] "VeryActiveDistance"       "ModeratelyActiveDistance"
##  [9] "LightActiveDistance"      "SedentaryActiveDistance" 
## [11] "VeryActiveMinutes"        "FairlyActiveMinutes"     
## [13] "LightlyActiveMinutes"     "SedentaryMinutes"        
## [15] "Calories"
glimpse(daily_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               <dbl> 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        <dbl> 25, 21, 30, 29, 36, 38, 42, 50, 28, 19, 66, 4~
## $ FairlyActiveMinutes      <dbl> 13, 19, 11, 34, 10, 20, 16, 31, 12, 8, 27, 21~
## $ LightlyActiveMinutes     <dbl> 328, 217, 181, 209, 221, 164, 233, 264, 205, ~
## $ SedentaryMinutes         <dbl> 728, 776, 1218, 726, 773, 539, 1149, 775, 818~
## $ Calories                 <dbl> 1985, 1797, 1776, 1745, 1863, 1728, 1921, 203~
head(daily_calories)
## # A tibble: 6 x 3
##           Id ActivityDay Calories
##        <dbl> <chr>          <dbl>
## 1 1503960366 4/12/2016       1985
## 2 1503960366 4/13/2016       1797
## 3 1503960366 4/14/2016       1776
## 4 1503960366 4/15/2016       1745
## 5 1503960366 4/16/2016       1863
## 6 1503960366 4/17/2016       1728
colnames(daily_calories)
## [1] "Id"          "ActivityDay" "Calories"
glimpse(daily_calories)
## Rows: 940
## Columns: 3
## $ Id          <dbl> 1503960366, 1503960366, 1503960366, 1503960366, 1503960366~
## $ ActivityDay <chr> "4/12/2016", "4/13/2016", "4/14/2016", "4/15/2016", "4/16/~
## $ Calories    <dbl> 1985, 1797, 1776, 1745, 1863, 1728, 1921, 2035, 1786, 1775~
head(sleep_day)
## # A tibble: 6 x 5
##           Id SleepDay          TotalSleepRecor~ TotalMinutesAsle~ TotalTimeInBed
##        <dbl> <chr>                        <dbl>             <dbl>          <dbl>
## 1 1503960366 4/12/2016 12:00:~                1               327            346
## 2 1503960366 4/13/2016 12:00:~                2               384            407
## 3 1503960366 4/15/2016 12:00:~                1               412            442
## 4 1503960366 4/16/2016 12:00:~                2               340            367
## 5 1503960366 4/17/2016 12:00:~                1               700            712
## 6 1503960366 4/19/2016 12:00:~                1               304            320
colnames(sleep_day)
## [1] "Id"                 "SleepDay"           "TotalSleepRecords" 
## [4] "TotalMinutesAsleep" "TotalTimeInBed"
glimpse(sleep_day)
## 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  <dbl> 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ~
## $ TotalMinutesAsleep <dbl> 327, 384, 412, 340, 700, 304, 360, 325, 361, 430, 2~
## $ TotalTimeInBed     <dbl> 346, 407, 442, 367, 712, 320, 377, 364, 384, 449, 3~
head(weight_log)
## # A tibble: 6 x 8
##           Id Date      WeightKg WeightPounds   Fat   BMI IsManualReport    LogId
##        <dbl> <chr>        <dbl>        <dbl> <dbl> <dbl> <lgl>             <dbl>
## 1 1503960366 5/2/2016~     52.6         116.    22  22.6 TRUE            1.46e12
## 2 1503960366 5/3/2016~     52.6         116.    NA  22.6 TRUE            1.46e12
## 3 1927972279 4/13/201~    134.          294.    NA  47.5 FALSE           1.46e12
## 4 2873212765 4/21/201~     56.7         125.    NA  21.5 TRUE            1.46e12
## 5 2873212765 5/12/201~     57.3         126.    NA  21.7 TRUE            1.46e12
## 6 4319703577 4/17/201~     72.4         160.    25  27.5 TRUE            1.46e12
colnames(weight_log)
## [1] "Id"             "Date"           "WeightKg"       "WeightPounds"  
## [5] "Fat"            "BMI"            "IsManualReport" "LogId"
glimpse(weight_log)
## Rows: 67
## Columns: 8
## $ Id             <dbl> 1503960366, 1503960366, 1927972279, 2873212765, 2873212~
## $ Date           <chr> "5/2/2016 11:59:59 PM", "5/3/2016 11:59:59 PM", "4/13/2~
## $ WeightKg       <dbl> 52.6, 52.6, 133.5, 56.7, 57.3, 72.4, 72.3, 69.7, 70.3, ~
## $ WeightPounds   <dbl> 115.9631, 115.9631, 294.3171, 125.0021, 126.3249, 159.6~
## $ Fat            <dbl> 22, NA, NA, NA, NA, 25, NA, NA, NA, NA, NA, NA, NA, NA,~
## $ BMI            <dbl> 22.65, 22.65, 47.54, 21.45, 21.69, 27.45, 27.38, 27.25,~
## $ IsManualReport <lgl> TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, ~
## $ LogId          <dbl> 1.462234e+12, 1.462320e+12, 1.460510e+12, 1.461283e+12,~
head(daily_intensities)
## # A tibble: 6 x 10
##           Id ActivityDay SedentaryMinutes LightlyActiveMinutes FairlyActiveMinu~
##        <dbl> <chr>                  <dbl>                <dbl>             <dbl>
## 1 1503960366 4/12/2016                728                  328                13
## 2 1503960366 4/13/2016                776                  217                19
## 3 1503960366 4/14/2016               1218                  181                11
## 4 1503960366 4/15/2016                726                  209                34
## 5 1503960366 4/16/2016                773                  221                10
## 6 1503960366 4/17/2016                539                  164                20
## # ... with 5 more variables: VeryActiveMinutes <dbl>,
## #   SedentaryActiveDistance <dbl>, LightActiveDistance <dbl>,
## #   ModeratelyActiveDistance <dbl>, VeryActiveDistance <dbl>
colnames(daily_intensities)
##  [1] "Id"                       "ActivityDay"             
##  [3] "SedentaryMinutes"         "LightlyActiveMinutes"    
##  [5] "FairlyActiveMinutes"      "VeryActiveMinutes"       
##  [7] "SedentaryActiveDistance"  "LightActiveDistance"     
##  [9] "ModeratelyActiveDistance" "VeryActiveDistance"
glimpse(daily_intensities)
## Rows: 940
## Columns: 10
## $ Id                       <dbl> 1503960366, 1503960366, 1503960366, 150396036~
## $ ActivityDay              <chr> "4/12/2016", "4/13/2016", "4/14/2016", "4/15/~
## $ SedentaryMinutes         <dbl> 728, 776, 1218, 726, 773, 539, 1149, 775, 818~
## $ LightlyActiveMinutes     <dbl> 328, 217, 181, 209, 221, 164, 233, 264, 205, ~
## $ FairlyActiveMinutes      <dbl> 13, 19, 11, 34, 10, 20, 16, 31, 12, 8, 27, 21~
## $ VeryActiveMinutes        <dbl> 25, 21, 30, 29, 36, 38, 42, 50, 28, 19, 66, 4~
## $ SedentaryActiveDistance  <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ~
## $ LightActiveDistance      <dbl> 6.06, 4.71, 3.91, 2.83, 5.04, 2.51, 4.71, 5.0~
## $ ModeratelyActiveDistance <dbl> 0.55, 0.69, 0.40, 1.26, 0.41, 0.78, 0.64, 1.3~
## $ VeryActiveDistance       <dbl> 1.88, 1.57, 2.44, 2.14, 2.71, 3.19, 3.25, 3.5~

Data cleaning

A)Removing duplicates

Id and activity date should be unique (0 observations removed)

daily_activity <- daily_activity %>%
  distinct(Id, ActivityDate, .keep_all = TRUE)

Id and activity date should be unique (3 observations removed)

sleep_day <- sleep_day %>% 
  distinct(Id, SleepDay, .keep_all = TRUE)

Id and Date should be unique (0 observations removed)

weight_log <- weight_log %>%
  distinct(Id, Date, .keep_all = TRUE)

B) Checking for NA values and removing if any exist

No NA value was found

which(!complete.cases(daily_activity))
## integer(0)
which(!complete.cases(sleep_day))
## integer(0)
which(!complete.cases(daily_intensities))
## integer(0)

in wight_Log there was (60) NA on FAT column

which(!complete.cases(weight_log))
##  [1]  2  3  4  5  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
## [26] 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
## [51] 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67

4) Analyze

For this case study I decided to use this merged 5 files:

  • daily_activity.

  • weight_log.

  • daily_intensities.

  • sleep_day.

Initial observations:

  • They all contain ID column.

  • daily_activity, daily_intensities and daily_calories has same Rows Number(940).

  • daily_activity contain all daily_calories attribute and daily_ intensities.

B) daily_activity VS daily_calories & daily_intensities

  • By creating temp data frame named it daily_activity_Temp
daily_activity_Temp1 <- daily_activity %>%
  select(Id, ActivityDate, Calories)

head(daily_activity_Temp1)
## # A tibble: 6 x 3
##           Id ActivityDate Calories
##        <dbl> <chr>           <dbl>
## 1 1503960366 4/12/2016        1985
## 2 1503960366 4/13/2016        1797
## 3 1503960366 4/14/2016        1776
## 4 1503960366 4/15/2016        1745
## 5 1503960366 4/16/2016        1863
## 6 1503960366 4/17/2016        1728
glimpse(daily_activity_Temp1)
## Rows: 940
## Columns: 3
## $ Id           <dbl> 1503960366, 1503960366, 1503960366, 1503960366, 150396036~
## $ ActivityDate <chr> "4/12/2016", "4/13/2016", "4/14/2016", "4/15/2016", "4/16~
## $ Calories     <dbl> 1985, 1797, 1776, 1745, 1863, 1728, 1921, 2035, 1786, 177~

we check if the two data frames of daily_activity_Temp1 and daily_calories are same.

first we:

install the (sqldf) package for ruining SQL statements on R data frames, optimized for convenience.

library(sqldf)
## Loading required package: gsubfn
## Loading required package: proto
## Loading required package: RSQLite
sql_check1 <- sqldf('SELECT * FROM daily_activity_Temp1 INTERSECT SELECT * FROM daily_calories')
head(sql_check1)
##           Id ActivityDate Calories
## 1 1503960366    4/12/2016     1985
## 2 1503960366    4/13/2016     1797
## 3 1503960366    4/14/2016     1776
## 4 1503960366    4/15/2016     1745
## 5 1503960366    4/16/2016     1863
## 6 1503960366    4/17/2016     1728
glimpse(sql_check1)
## Rows: 940
## Columns: 3
## $ Id           <dbl> 1503960366, 1503960366, 1503960366, 1503960366, 150396036~
## $ ActivityDate <chr> "4/12/2016", "4/13/2016", "4/14/2016", "4/15/2016", "4/16~
## $ Calories     <dbl> 1985, 1797, 1776, 1745, 1863, 1728, 1921, 2035, 1786, 177~
  • it’s safe to assume that the values are the same between the data frames.

  • the same is true for daily intensities, so we can drop those two data frames from analysis.

That leaves us with (3) data frames:

  • daily_activity.

  • sleep_day.

  • weight_log.

let check the Number of Id’s in daily_activity and sleep_day

n_distinct(daily_activity$Id)
## [1] 33
n_distinct(sleep_day$Id)
## [1] 24
n_distinct(weight_log$Id)
## [1] 8

let check the number of observation in each

nrow(daily_activity)
## [1] 940
nrow(sleep_day)
## [1] 410
nrow(weight_log)
## [1] 67

Statistical Calculation summery

A) daily_activity

daily_activity %>%
  select(TotalSteps, TotalDistance, VeryActiveMinutes, SedentaryMinutes, Calories) %>%
  summary()
##    TotalSteps    TotalDistance    VeryActiveMinutes SedentaryMinutes
##  Min.   :    0   Min.   : 0.000   Min.   :  0.00    Min.   :   0.0  
##  1st Qu.: 3790   1st Qu.: 2.620   1st Qu.:  0.00    1st Qu.: 729.8  
##  Median : 7406   Median : 5.245   Median :  4.00    Median :1057.5  
##  Mean   : 7638   Mean   : 5.490   Mean   : 21.16    Mean   : 991.2  
##  3rd Qu.:10727   3rd Qu.: 7.713   3rd Qu.: 32.00    3rd Qu.:1229.5  
##  Max.   :36019   Max.   :28.030   Max.   :210.00    Max.   :1440.0  
##     Calories   
##  Min.   :   0  
##  1st Qu.:1828  
##  Median :2134  
##  Mean   :2304  
##  3rd Qu.:2793  
##  Max.   :4900

B) sleep_day

sleep_day %>%
  select(TotalSleepRecords, TotalMinutesAsleep, TotalTimeInBed) %>%
  summary()
##  TotalSleepRecords TotalMinutesAsleep TotalTimeInBed 
##  Min.   :1.00      Min.   : 58.0      Min.   : 61.0  
##  1st Qu.:1.00      1st Qu.:361.0      1st Qu.:403.8  
##  Median :1.00      Median :432.5      Median :463.0  
##  Mean   :1.12      Mean   :419.2      Mean   :458.5  
##  3rd Qu.:1.00      3rd Qu.:490.0      3rd Qu.:526.0  
##  Max.   :3.00      Max.   :796.0      Max.   :961.0

C) weight_log

weight_log %>%
  select(WeightKg,BMI) %>%
  summary()
##     WeightKg           BMI       
##  Min.   : 52.60   Min.   :21.45  
##  1st Qu.: 61.40   1st Qu.:23.96  
##  Median : 62.50   Median :24.39  
##  Mean   : 72.04   Mean   :25.19  
##  3rd Qu.: 85.05   3rd Qu.:25.56  
##  Max.   :133.50   Max.   :47.54

5) Share

few explorations

Total steps VS sedentary minutes

ggplot(data = daily_activity, aes(x= TotalSteps, y= SedentaryMinutes, color= Calories)) +
  geom_point(color="#ca6708") +
   labs(title="Total steps VS Sedentary minutes", x="Total Steps", y="Sendentary Minutes")

  • Its look like negative relationship between total steps taken and sedentary Minutes.

Total steps VS Calories

ggplot(data=daily_activity, aes(x=TotalSteps, y = Calories))+ 
  geom_point(color="#ca6708") +
   labs(title="Total steps VS Calories", x="Total Steps", y="Calories") + stat_smooth(method=lm)
## `geom_smooth()` using formula 'y ~ x'

  • Calories generally trend positively with total steps taking.

  • we can assume This shows that the data seem fairly accurate when it comes to recording steps and sedentary minutes.

  • we could also market the devices as a way to let people know how sedentary they actually are.

  • We can also note that sedentary time is not necessarily related to calories burned.

in general the people who took the most total steps tended to burn the most calories however, there’s a large spread there clustered towards the lower amounts.

calories.lm <- lm(Calories ~ TotalSteps, data = daily_activity)
calories.res <- resid(calories.lm)

plot(daily_activity$TotalSteps, calories.res, ylab="Residuals",xlab = "Total Steps", main = "Calories Burned", )

Now lets plot the density of the residuals

plot(density(calories.res))

Checking for normality

qqnorm(calories.res)
qqline(calories.res)

  • looks like the spread isn’t as far statistically as we though

A potential strategy

  • In order to burn calories, you don’t have to do high-intensity work outs, you can just get out there and start walking,

Sleep VS Time in Bed

1:1 trend from the amount of time slept and the total time someone spends in bed

ggplot(data=sleep_day, aes(x=TotalMinutesAsleep, y=TotalTimeInBed)) +
  geom_point(color="#ca6708") +
   labs(title="Total Minutes Sleep VS Total Time In Bed", x="Total Minutes Sleep", y="Total Time In Bed")

  • there are some outliers.some data points that spent a lot of time in bed, but didn’t actually sleep, and then a small batch that slept a whole bunch and spent time in bed

  • We could definitely market to consumers to monitor their time in bed with the watch against their sleep time.and could add some apps like night meditation or any sleeping aids voice books.

sedentary minutes VS Sleep

Merging these two datasets together

combined_sleep_day_data <- merge(sleep_day, daily_activity, by="Id")
head(combined_sleep_day_data)
##           Id              SleepDay TotalSleepRecords TotalMinutesAsleep
## 1 1503960366 4/12/2016 12:00:00 AM                 1                327
## 2 1503960366 4/12/2016 12:00:00 AM                 1                327
## 3 1503960366 4/12/2016 12:00:00 AM                 1                327
## 4 1503960366 4/12/2016 12:00:00 AM                 1                327
## 5 1503960366 4/12/2016 12:00:00 AM                 1                327
## 6 1503960366 4/12/2016 12:00:00 AM                 1                327
##   TotalTimeInBed ActivityDate TotalSteps TotalDistance TrackerDistance
## 1            346     5/7/2016      11992          7.71            7.71
## 2            346     5/6/2016      12159          8.03            8.03
## 3            346     5/1/2016      10602          6.81            6.81
## 4            346    4/30/2016      14673          9.25            9.25
## 5            346    4/12/2016      13162          8.50            8.50
## 6            346    4/13/2016      10735          6.97            6.97
##   LoggedActivitiesDistance VeryActiveDistance ModeratelyActiveDistance
## 1                        0               2.46                     2.12
## 2                        0               1.97                     0.25
## 3                        0               2.29                     1.60
## 4                        0               3.56                     1.42
## 5                        0               1.88                     0.55
## 6                        0               1.57                     0.69
##   LightActiveDistance SedentaryActiveDistance VeryActiveMinutes
## 1                3.13                       0                37
## 2                5.81                       0                24
## 3                2.92                       0                33
## 4                4.27                       0                52
## 5                6.06                       0                25
## 6                4.71                       0                21
##   FairlyActiveMinutes LightlyActiveMinutes SedentaryMinutes Calories
## 1                  46                  175              833     1821
## 2                   6                  289              754     1896
## 3                  35                  246              730     1820
## 4                  34                  217              712     1947
## 5                  13                  328              728     1985
## 6                  19                  217              776     1797
n_distinct(combined_sleep_day_data$Id)
## [1] 24
  • there are only 24 unique id’s in the combined dataset.

  • since only 24 users actively used the sleep data.

Sedentary Time vs Time In Bed

sedentary.lm <- lm(SedentaryMinutes ~ TotalTimeInBed, data = combined_sleep_day_data)
sedentary.lm
## 
## Call:
## lm(formula = SedentaryMinutes ~ TotalTimeInBed, data = combined_sleep_day_data)
## 
## Coefficients:
##    (Intercept)  TotalTimeInBed  
##       922.5632         -0.2688

now a pearson correlation coefficient

cor(combined_sleep_day_data$TotalTimeInBed,combined_sleep_day_data$SedentaryMinutes, method = "pearson")
## [1] -0.1286386
  • As time in bed goes up, sedentary minutes actually go down, but not to a statistically significant degree.

Very active minutes vs calories burned

ggplot(data = combined_sleep_day_data, aes(x=VeryActiveMinutes, y=Calories)) + 
  geom_point(color="#ca6708") + geom_smooth(method = 'loess', formula = y ~ x) + 
  labs(title="Very Active Minutes vs. Calories Burned", x="VeryActiveMinutes", y="Calories Burned")
## Warning: Computation failed in `stat_smooth()`:
## 'Calloc' could not allocate memory (228842447 of 8 bytes)

  • A Moderate relationship for fairly active minutes.
ggplot(data = combined_sleep_day_data, aes(x=FairlyActiveMinutes, y=Calories)) + 
   geom_point(color="#ca6708") +
   labs(title="Fairly Active Minutes VS Calories", x="Fairly Active Minutes", y=" Calories")+
  stat_smooth(method = lm)
## `geom_smooth()` using formula 'y ~ x'

lm(Calories ~ FairlyActiveMinutes, data = combined_sleep_day_data)
## 
## Call:
## lm(formula = Calories ~ FairlyActiveMinutes, data = combined_sleep_day_data)
## 
## Coefficients:
##         (Intercept)  FairlyActiveMinutes  
##            2205.987                6.739

6) Act

Takeaway And Recommendations :

  1. Adding some additional data capture techniques like hydration data, that puts Bellabeat way above the competition.

  2. We should focus on marketing the fact that collecting data will help you (customer) set goals.

  3. Marketing team can encourage users by educating and equipping them with knowledge about fitness benefits, suggest different types of exercise and calories intake and burnt rate information on the Bellabeat app. this provides a unique opportunity for individuals to change their behavior, become more physically active and increase their life expectancy.

  4. adding features like notifications,competitions into the wearable’s ( eg. on weekends, Bellabeat app can rompt notification to encourage users to exercise)

  5. Add some sleep aids tools like meditation or audio book and its can be monetized.

  6. Make the device more comfortable on sleep and adding sleep tracking features.

  7. We could market to consumers by telling them smart-devices could help them start their journey by measuring how much they’re already moving.