-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path02_analyze.Rmd
More file actions
262 lines (206 loc) · 9.21 KB
/
Copy path02_analyze.Rmd
File metadata and controls
262 lines (206 loc) · 9.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
---
title: "Bellabeat Case Study — Data Analysis"
author: "AHMAD DANIEL"
date: "2026-05-14"
output: html_document
---
# Bellabeat Case Study — Data Analysis
**Author:** [AHMAD DANIEL]
**Date:** `r Sys.Date()`
**Phase:** Analyze (Phase 4 of 6)
## Purpose
This notebook answers the three business questions:
1. What are the trends in smart device usage?
2. How could these trends apply to Bellabeat customers?
3. How could these trends help influence Bellabeat marketing strategy?
Each section ends with a plain-English insight that will inform the
recommendations in Phase 6.
## Setup
```{r setup, message=FALSE, warning=FALSE}
library(tidyverse)
library(lubridate)
library(scales)
# Load the clean datasets produced in Phase 3
daily_activity <- read_csv("../data/clean/daily_activity_clean.csv")
sleep_day <- read_csv("../data/clean/sleep_day_clean.csv")
hourly_steps <- read_csv("../data/clean/hourly_steps_clean.csv")
hourly_calories <- read_csv("../data/clean/hourly_calories_clean.csv")
user_activity_summary <- read_csv("../data/clean/user_activity_summary.csv")
usage_frequency <- read_csv("../data/clean/usage_frequency.csv")
activity_sleep <- read_csv("../data/clean/activity_sleep_joined.csv")
# Re-apply factor levels (lost during CSV export)
daily_activity$day_of_week <- factor(
daily_activity$day_of_week,
levels = c("Monday", "Tuesday", "Wednesday", "Thursday",
"Friday", "Saturday", "Sunday")
)
user_activity_summary$user_type <- factor(
user_activity_summary$user_type,
levels = c("Sedentary", "Lightly Active", "Fairly Active", "Very Active")
)
```
---
## Analysis 1: Overall daily activity baseline
```{r analysis-1-baseline}
daily_activity %>%
summarise(
avg_steps = round(mean(total_steps), 0),
median_steps = median(total_steps),
avg_calories = round(mean(calories), 0),
avg_distance_km = round(mean(total_distance), 2),
avg_sedentary_min = round(mean(sedentary_minutes), 0),
avg_very_active_min = round(mean(very_active_minutes), 0),
avg_fairly_active_min = round(mean(fairly_active_minutes), 0),
avg_lightly_active_min = round(mean(lightly_active_minutes), 0)
)
```
**Insight:** The average user logs ~7,638 steps daily — below the
commonly cited 10,000-step target — and spends the overwhelming
majority of their day in sedentary minutes. Active minutes are
concentrated in light intensity, not vigorous activity.
**Marketing implication:** Bellabeat messaging should target the
*realistic* user (busy, mostly sedentary, building habits) rather than
the elite fitness user. Aspirational-but-achievable framing will
resonate more than hardcore performance positioning.
---
## Analysis 2: Activity by day of the week
```{r analysis-2-day-of-week}
daily_activity %>%
group_by(day_of_week) %>%
summarise(avg_steps = round(mean(total_steps), 0),
avg_calories = round(mean(calories), 0),
n_records = n()) %>%
arrange(day_of_week)
```
**Insight:** Activity varies meaningfully across the week. Identify your
highest and lowest days from the output above. Common pattern:
**Saturday peaks, Sunday dips, weekdays are mid-range with Tuesday/Wednesday
slightly higher**.
**Marketing implication:** Sunday is the natural low point — a prime
target for motivational push notifications. Saturday's high activity
suggests users are open to social/outdoor wellness content on weekends.
---
## Analysis 3: User segmentation deep-dive
```{r analysis-3-segments}
user_activity_summary %>%
group_by(user_type) %>%
summarise(
n_users = n(),
pct_of_users = round(n() / nrow(user_activity_summary) * 100, 1),
avg_steps = round(mean(avg_daily_steps), 0),
avg_calories = round(mean(avg_daily_calories), 0)
)
```
**Insight:** Roughly 51% of users fall into the lower-activity tiers
(Sedentary + Lightly Active). Only 21% are Very Active. The "average
Fitbit user" is far from a fitness elite — they're a habit-builder.
**Marketing implication:** Bellabeat should design content tracks for
different user types. The Sedentary/Lightly Active segment is the
largest and represents the biggest revenue opportunity for premium
membership (they need guidance most).
---
## Analysis 4: Steps and calories correlation
```{r analysis-4-correlation}
# Pearson correlation between steps and calories
cor_value <- cor(daily_activity$total_steps, daily_activity$calories)
round(cor_value, 3)
```
**Insight:** A correlation of 0.592 indicates a **moderate-to-strong
positive relationship** between steps and calories — more steps
generally mean more calories burned, but step count alone doesn't
fully explain calorie burn. Active intensity and body composition matter too.
**Marketing implication:** The Bellabeat app should educate users that
*intensity matters as much as distance*. Promote features like active
minutes and heart-rate-based zones, not just step counts.
---
## Analysis 5: Time-of-day activity patterns
```{r analysis-5-hourly}
hourly_steps %>%
group_by(hour) %>%
summarise(avg_steps = round(mean(step_total), 0)) %>%
arrange(desc(avg_steps)) %>%
head(10)
```
**Insight:** Peak activity hours typically cluster around **5–7 PM**
(post-work) and **12–2 PM** (lunch break). Mornings before 8 AM and
evenings after 9 PM are low-activity windows.
**Marketing implication:** Push notifications and content delivery
should target the **11 AM** and **4 PM** windows — right before users'
natural activity peaks. Reminders sent at 8 PM (post-peak) are likely
wasted.
---
## Analysis 6: Sleep behavior
```{r analysis-6-sleep}
sleep_day %>%
summarise(
avg_minutes_asleep = round(mean(total_minutes_asleep), 0),
avg_hours_asleep = round(mean(total_minutes_asleep) / 60, 1),
avg_time_in_bed = round(mean(total_time_in_bed), 0),
avg_time_awake_in_bed = round(mean(total_time_in_bed - total_minutes_asleep), 0),
avg_sleep_efficiency_pct = round(mean(total_minutes_asleep / total_time_in_bed) * 100, 1)
)
```
**Insight:** Users average roughly **7 hours of sleep** but spend about
**~40 extra minutes in bed not sleeping**. Sleep efficiency hovers
around 91% — meaningful, since the gap between "in bed" and "asleep"
represents friction (scrolling phones, anxiety, restlessness).
**Marketing implication:** The Bellabeat app's mindfulness features
have a direct, quantifiable problem to solve: helping users fall
asleep faster. A "wind-down" campaign positioning mindfulness as the
bridge to sleep onset has strong data support.
---
## Analysis 7: Engagement intensity
```{r analysis-7-engagement}
usage_frequency %>%
group_by(usage_category) %>%
summarise(
n_users = n(),
pct_of_users = round(n() / nrow(usage_frequency) * 100, 1),
avg_days_used = round(mean(days_used), 1)
)
```
**Insight:** **88% of users (29 of 33) used the device 21+ days** out of
31. Only 1 user dropped to low use. This contradicts the common
narrative that smart device users abandon trackers quickly — these
users are **highly committed once they start**.
**Marketing implication:** The marketing challenge is NOT churn — it's
**acquisition and depth**. Once a user adopts the device, they stick.
Investment should prioritize:
1. Onboarding conversion (turning visitors into first-time users)
2. Feature depth (turning passive trackers into active goal-pursuers)
3. Premium membership upsell (committed users will pay for guidance)
---
## Analysis 8: Active vs sedentary time deep-dive
```{r analysis-8-sedentary}
daily_activity %>%
summarise(
avg_sedentary_hrs = round(mean(sedentary_minutes) / 60, 1),
avg_lightly_active_hrs = round(mean(lightly_active_minutes) / 60, 1),
avg_fairly_active_hrs = round(mean(fairly_active_minutes) / 60, 2),
avg_very_active_hrs = round(mean(very_active_minutes) / 60, 2),
total_tracked_hrs = round(
(mean(sedentary_minutes) + mean(lightly_active_minutes) +
mean(fairly_active_minutes) + mean(very_active_minutes)) / 60, 1)
)
```
**Insight:** Users are sedentary for roughly **16 hours per day**
(including sleep) and only spend ~30 minutes combined in fairly or very
active states. The gap between "tracked" and "active" is enormous.
**Marketing implication:** The biggest opportunity isn't getting users
to exercise more intensely — it's reducing prolonged sedentary
periods. Hourly "stand and stretch" nudges (something the Bellabeat
app could easily implement) would address the largest behavioral gap.
---
## Headline Findings Summary
| # | Finding | Implication |
|---|---------|-------------|
| 1 | Avg user: ~7,638 steps/day (below 10K target) | Target realistic users, not elites |
| 2 | Activity varies by day; Sunday is the low point | Sunday motivational campaigns |
| 3 | 51% of users are Sedentary or Lightly Active | Largest segment = biggest opportunity |
| 4 | Steps↔Calories correlation: moderate (~0.4-0.6) | Promote intensity, not just steps |
| 5 | Peak activity: 12-2 PM and 5-7 PM | Notify at 11 AM and 4 PM |
| 6 | ~40 min spent awake in bed nightly | Mindfulness as sleep-onset solution |
| 7 | 88% use device 21+ days | Marketing problem is acquisition, not churn |
| 8 | ~16 sedentary hours/day | Hourly stand reminders > intense workout pushes |
Proceed to **Phase 5: Share** in `notebooks/03_share.Rmd`, where these
findings become visualizations.