This dashboard applies the principles of the Quantified Self (QS) movement to analyze my personal PCOS and weight loss journey. The primary objective is to understand how daily lifestyle factors such as sleep, physical activity, nutrition, and physiological conditions influence my overall well-being and consistency.
The analysis is structured around five key research questions, each explored through data visualization and comparative analysis to identify patterns and relationships across variables.
My PCOS and weight loss journey has not been defined solely by changes in weight. Instead, it has been shaped by fluctuations in energy, cravings, mood, and the ability to maintain a consistent daily routine. Some days feel structured and productive, while others are influenced by fatigue, cravings, or physical discomfort.
This project allows me to move beyond assumptions by tracking these experiences as measurable data. By doing so, I can better understand which habits support my progress and which factors disrupt it.
This dashboard is structured around the following key analytical questions:
How does sleep duration affect my energy levels and cravings?
Do higher step counts and workout minutes improve my mood and productivity?
How does protein intake influence hunger levels and snacking behavior?
Are carb-dense meals associated with afternoon energy crashes?
How do PCOS symptoms and cycle-related changes affect my daily habits and overall weight-loss consistency?
Below are the Key metrics to examine the questions of interest.
How does sleep duration affect my energy levels and cravings?
The visualizations suggest that sleep duration is positively associated with next-day energy and negatively associated with cravings. Days with shorter sleep tend to correspond with lower energy scores, while days with longer sleep generally align with improved energy levels.
A similar pattern is observed for cravings, where lower sleep is linked with stronger cravings and less stable appetite control. The category-based comparison further shows that cravings tend to decrease as sleep duration increases.
Overall, these findings indicate that sleep may be an important behavioral factor influencing both daily performance and eating patterns, which are critical for maintaining consistency in a weight-loss journey.
This section examines whether higher daily movement and workout time are associated with better mood and productivity. Physical activity is an important part of both weight management and PCOS support, but its impact is not only physical.
The results show a positive relationship between physical activity and both mood and productivity. Higher step counts are associated with improved mood scores, while low activity days tend to cluster around lower mood levels. The activity-level comparison further supports this, with high activity days showing consistently higher mood scores.
Productivity follows a similar pattern, where higher step counts align with higher productivity levels. Low activity days are associated with lower productivity, while moderate and high activity days show stronger performance.
Overall, these findings suggest that increased physical activity supports both emotional well-being and productivity, making it an important factor in maintaining consistency in a weight-loss and PCOS management routine.
This section examines whether higher protein intake is associated with lower hunger levels and reduced snacking behavior. Protein plays an important role in satiety and appetite control, which are especially relevant in a weight-loss journey and in managing eating patterns affected by PCOS.
The visualizations show a strong inverse relationship between protein intake and hunger levels. The scatter plot indicates that lower protein intake is consistently associated with higher hunger scores, while higher protein intake corresponds with lower and more stable hunger levels. This suggests that increasing protein intake may significantly improve satiety throughout the day.
The category-based comparison further reinforces this pattern. Low-protein days are clustered around higher hunger levels, while moderate-protein days show a noticeable reduction in hunger. High-protein days are associated with the lowest hunger levels and the least variability, indicating more consistent appetite control.
Overall, these findings highlight protein as a key nutritional factor in regulating hunger and reducing snacking behavior. For a weight-loss and PCOS management journey, maintaining adequate protein intake may support better appetite control, improve dietary consistency, and reduce the likelihood of overeating.
This section examines whether carb-dense meals are associated with afternoon energy crashes. For weight management and PCOS, meal composition can affect energy stability, cravings, and overall consistency throughout the day.
The results show that carb-dense meals are associated with a higher likelihood of afternoon crashes. Crash events frequently occur on days with carb-heavy meals, while non-carb days are mostly linked with stable energy.
Cravings also tend to be higher on carb-dense meal days, suggesting a connection between energy crashes and increased appetite.
Overall, these findings indicate that carb-heavy meals may contribute to energy instability and stronger cravings, which can affect consistency in a weight-loss and PCOS management routine.
Cycle-related changes affect mood, energy, cravings, and overall consistency. Mood and energy are higher during the follicular and ovulatory phases, while they decline in the late luteal phase.
Cravings increase in the later phases, especially in the late luteal phase, where consistency is also lowest. In contrast, the ovulatory phase shows the highest consistency along with stronger mood and energy.
Overall, these patterns suggest that cycle-related fluctuations can impact daily habits and weight-loss consistency, with some phases being more supportive than others.
This dashboard applied a Quantified Self approach to understand how sleep, activity, nutrition, carb-dense meals, and cycle-related changes influence my PCOS and weight-loss journey. The correlation heatmap provides an integrated view of how these factors interact rather than acting independently.
The heatmap reinforces several key patterns observed throughout the dashboard. Sleep shows a positive relationship with energy and mood, while lower sleep is associated with higher cravings. Physical activity is positively linked with mood and productivity, supporting the role of movement in improving both mental and functional well-being.
Nutritional patterns are also clearly reflected. Protein intake shows a negative relationship with hunger and cravings, while carb-dense meals align with higher cravings and energy instability. These patterns support the earlier findings that meal composition plays an important role in appetite regulation and consistency.
Cycle-related variables show associations with mood, energy, and cravings, indicating that hormonal fluctuations may influence daily habits and weight-loss consistency. Phases with lower energy and higher cravings appear to align with reduced consistency.
Overall, the heatmap highlights that my weight-loss and PCOS journey is influenced by a network of interconnected factors. Rather than a single habit driving outcomes, it is the combination of sleep, activity, nutrition, and cycle-related changes that shapes consistency and progress. This reinforces the importance of taking a holistic and adaptive approach to managing both health and routine.
Business Review Live. (n.d.). 8 out of 10 women revealed that PCOS had affected their self-esteem and body image [Image]. https://businessreviewlive.com/8-out-of-10-women-revealed-that-pcos-had-affected-their-self-esteem-and-body-image-2/
Quantified Self. (n.d.). Quantified Self. http://quantifiedself.com/
Tufte, E. R. (2001). The visual display of quantitative information (2nd ed.). Graphics Press.
Wexler, S., Shaffer, J., & Cotgreave, A. (2017). The big book of dashboards. Wiley.
R Core Team. (2023). R: A language and environment for statistical computing. https://www.r-project.org/
Iannone, R., Allaire, J., & Borges, B. (2020). flexdashboard: R Markdown format for flexible dashboards. https://rmarkdown.rstudio.com/flexdashboard/
Wickham, H. (2016). ggplot2: Elegant graphics for data analysis. Springer.
Teede, H. J., et al. (2018). International evidence-based guideline for the assessment and management of polycystic ovary syndrome. Human Reproduction.
Leidy, H. J., et al. (2015). The role of protein in weight loss and maintenance. American Journal of Clinical Nutrition.
---
title: "Final Project"
author: "Lipi Thakker"
date: "2026-04-19"
output:
flexdashboard::flex_dashboard:
orientation: rows
vertical_layout: fill
theme:
version: 5
bootswatch: flatly
source_code: embed
---
<style>
.section.level1 {
padding-top: 10px !important;
}
body {
padding-top: 130px !important;
}
.dashboard-row {
margin-top: 8px !important;
}
.chart-title {
font-weight: 600 !important;
}
.navbar {
min-height: 110px !important;
}
.navbar-nav > li > a {
font-size: 14px !important;
padding-top: 12px !important;
padding-bottom: 12px !important;
}
/* Main page/tab titles */
body .section.level1 h1,
body .section.level1 > h1,
body h1 {
font-size: 15px !important;
font-weight: 600 !important;
margin-top: 0 !important;
margin-bottom: 10px !important;
line-height: 1.2 !important;
}
</style>
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, warning = FALSE, message = FALSE)
library(flexdashboard)
library(tidyverse)
library(plotly)
library(scales)
library(lubridate)
library(DT)
library(janitor)
library(htmltools)
library(janitor)
library(readxl)
library(shiny)
```
```{r}
qs <- read_excel("pcos_qs_30days.xlsx")
```
```{r data wrangling}
library(dplyr)
library(lubridate)
# Clean and transform
qs <- qs %>%
mutate(
date = as.Date(date),
day = factor(day, levels = c("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun")),
weekend = ifelse(day %in% c("Sat", "Sun"), "Weekend", "Weekday"),
weekend = factor(weekend, levels = c("Weekday", "Weekend")),
snacking = factor(snacking, levels = c("No", "Yes")),
carb_dense_meal = factor(carb_dense_meal, levels = c("No", "Yes")),
afternoon_crash = factor(afternoon_crash, levels = c("No", "Yes")),
cycle_phase = factor(
cycle_phase,
levels = c("Menstrual", "Follicular", "Ovulatory", "Early Luteal", "Mid Luteal", "Late Luteal")
),
sleep_category = case_when(
sleep_hours < 6.5 ~ "Low Sleep",
sleep_hours >= 6.5 & sleep_hours <= 7.5 ~ "Adequate Sleep",
sleep_hours > 7.5 ~ "High Sleep"
),
sleep_category = factor(
sleep_category,
levels = c("Low Sleep", "Adequate Sleep", "High Sleep")
),
activity_level = case_when(
steps < 5000 ~ "Low Activity",
steps >= 5000 & steps < 9000 ~ "Moderate Activity",
steps >= 9000 ~ "High Activity"
),
activity_level = factor(
activity_level,
levels = c("Low Activity", "Moderate Activity", "High Activity")
),
protein_category = case_when(
protein_g < 70 ~ "Low Protein",
protein_g >= 70 & protein_g < 90 ~ "Moderate Protein",
protein_g >= 90 ~ "High Protein"
),
protein_category = factor(
protein_category,
levels = c("Low Protein", "Moderate Protein", "High Protein")
),
workout_day = ifelse(workout_minutes > 0, "Yes", "No"),
workout_day = factor(workout_day, levels = c("No", "Yes")),
good_day = ifelse(productivity_score >= 4 & mood_score >= 4, "Yes", "No"),
good_day = factor(good_day, levels = c("No", "Yes")),
weight_change = weight_lb - lag(weight_lb)
)
# Dashboard metrics
avg_sleep <- round(mean(qs$sleep_hours, na.rm = TRUE), 1)
avg_steps <- round(mean(qs$steps, na.rm = TRUE), 0)
avg_productivity <- mean(qs$productivity_score, na.rm = TRUE)
avg_mood <- round(mean(qs$mood_score, na.rm = TRUE), 1)
avg_protein <- round(mean(qs$protein_g, na.rm = TRUE), 0)
good_day_pct <- round(mean(qs$good_day == "Yes", na.rm = TRUE) * 100, 1)
avg_energy <- round(mean(qs$next_day_energy, na.rm = TRUE), 1)
avg_cravings <- round(mean(qs$cravings_level, na.rm = TRUE), 1)
avg_workout <- round(mean(qs$workout_minutes, na.rm = TRUE), 0)
avg_hunger <- round(mean(qs$hunger_level, na.rm = TRUE), 1)
snack_pct <- round(mean(qs$snacking == "Yes", na.rm = TRUE) * 100, 1)
carb_dense_pct <- round(mean(qs$carb_dense_meal == "Yes", na.rm = TRUE) * 100, 1)
crash_pct <- round(mean(qs$afternoon_crash == "Yes", na.rm = TRUE) * 100, 1)
most_common_phase <- names(sort(table(qs$cycle_phase), decreasing = TRUE))[1]
# Correlation data
num_data <- qs %>%
select(
sleep_hours,
next_day_energy,
cravings_level,
steps,
workout_minutes,
mood_score,
productivity_score,
protein_g,
hunger_level,
pcos_symptom_score,
habit_consistency,
weight_lb
)
corr_matrix <- cor(num_data, use = "complete.obs")
```
Introduction
=======================================================================
Column
-----------------------------------------------------------------------
```{r echo=FALSE, out.width="110%"}
knitr::include_graphics("lets get better.png")
```
### Project Agenda
This dashboard applies the principles of the Quantified Self (QS) movement to analyze my personal PCOS and weight loss journey. The primary objective is to understand how daily lifestyle factors such as sleep, physical activity, nutrition, and physiological conditions influence my overall well-being and consistency.
The analysis is structured around five key research questions, each explored through data visualization and comparative analysis to identify patterns and relationships across variables.
### Personal Journey
My PCOS and weight loss journey has not been defined solely by changes in weight. Instead, it has been shaped by fluctuations in energy, cravings, mood, and the ability to maintain a consistent daily routine. Some days feel structured and productive, while others are influenced by fatigue, cravings, or physical discomfort.
This project allows me to move beyond assumptions by tracking these experiences as measurable data. By doing so, I can better understand which habits support my progress and which factors disrupt it.
### Research Questions
This dashboard is structured around the following key analytical questions:
1. How does sleep duration affect my energy levels and cravings?
2. Do higher step counts and workout minutes improve my mood and productivity?
3. How does protein intake influence hunger levels and snacking behavior?
4. Are carb-dense meals associated with afternoon energy crashes?
5. How do PCOS symptoms and cycle-related changes affect my daily habits and overall weight-loss consistency?
Below are the Key metrics to examine the questions of interest.
Row
-----------------------------------------------------------------------
### Avg Sleep
```{r echo=FALSE}
valueBox(
value = paste0(round(avg_sleep, 1), " hrs"),
caption = "Average Sleep Hours",
icon = "fa-bed",
color = "purple"
)
```
### Avg Steps
```{r}
valueBox(
value = format(round(avg_steps, 0), big.mark = ","),
caption = "Average Daily Steps",
icon = "fa-line-chart",
color = "green"
)
```
### Protein Intake
```{r}
valueBox(
value = paste0(round(avg_protein, 0), " g"),
caption = "Average Protein Intake",
icon = "fa-cutlery",
color = "orange"
)
```
### Mood & Productivity
```{r}
valueBox(
value = paste0(round(good_day_pct, 1), "%"),
caption = "High Mood & Productivity Days",
icon = "fa-smile-o",
color = "blue"
)
```
Row
-----------------------------------------------------------------------
<div style="text-align:center; font-size:14px; font-style:italic; margin-top:8px;"> Figure 1. Image illustrating the impact of PCOS on self-esteem and lifestyle (Business Review Live, n.d.). </div>
Sleep, Energy & Cravings
=======================================================================
How does sleep duration affect my energy levels and cravings?
Row
-----------------------------------------------------------------------
### My Energy Level
```{r}
valueBox(
value = avg_energy,
caption = "Average Next-Day Energy",
icon = "fa-bolt",
color = "purple"
)
```
### Cravings
```{r}
valueBox(
value = avg_cravings,
caption = "Average Cravings Level",
icon = "fa-utensils",
color = "yellow"
)
```
Column
-----------------------------------------------------------------------
### Daily Sleep Duration Trend
```{r echo=FALSE, message=FALSE, warning=FALSE}
library(ggplot2)
ggplot(qs, aes(x = date, y = sleep_hours)) +
geom_line(color = "#6A1B9A", linewidth = 1.2) + # purple line
geom_point(color = "#FF6F00", size = 3) + # orange points
labs(
x = "Date",
y = "Sleep Hours"
) +
theme_minimal() +
theme(
axis.text.x = element_text(angle = 45, hjust = 1),
axis.title = element_text(size = 12),
plot.margin = margin(10, 10, 10, 10),
panel.grid.minor = element_blank()
)
```
### Cravings by Sleep Category
```{r echo=FALSE, message=FALSE, warning=FALSE}
ggplot(qs, aes(x = sleep_category, y = cravings_level, color = sleep_category)) +
geom_jitter(width = 0.15, size = 3, alpha = 0.8) +
stat_summary(
fun = mean,
geom = "point",
size = 5,
shape = 18,
color = "black"
) +
scale_color_manual(
values = c(
"Low Sleep" = "#D32F2F", # red
"Adequate Sleep" = "#1976D2", # blue
"High Sleep" = "#388E3C" # green
)
) +
labs(
x = "Sleep Category",
y = "Cravings Level",
color = "Sleep Category"
) +
theme_minimal() +
theme(
axis.title = element_text(size = 11),
legend.position = "side"
)
```
### Interactive View: Sleep Duration vs Cravings
```{r echo=FALSE, message=FALSE, warning=FALSE}
library(plotly)
p_sleep_cravings <- ggplot(qs, aes(
x = sleep_hours,
y = cravings_level,
color = sleep_category,
text = paste(
"Date:", date,
"<br>Sleep Hours:", sleep_hours,
"<br>Cravings:", cravings_level,
"<br>Energy:", next_day_energy,
"<br>Sleep Category:", sleep_category
)
)) +
geom_point(size = 3, alpha = 0.85) +
geom_smooth(method = "lm", se = FALSE, linewidth = 1, color = "black") +
scale_color_manual(
values = c(
"Low Sleep" = "#D32F2F", # red
"Adequate Sleep" = "#1976D2", # blue
"High Sleep" = "#388E3C" # green
)
) +
labs(
x = "Sleep Hours",
y = "Cravings Level",
color = "Sleep Category"
) +
theme_minimal() +
theme(
axis.title = element_text(size = 11),
legend.position = "side"
)
ggplotly(p_sleep_cravings, tooltip = "text") %>%
layout(height = 350)
```
Row {data-height=150}
-----------------------------------------------------------------------
### Sleep Insights
The visualizations suggest that sleep duration is positively associated with next-day energy and negatively associated with cravings. Days with shorter sleep tend to correspond with lower energy scores, while days with longer sleep generally align with improved energy levels.
A similar pattern is observed for cravings, where lower sleep is linked with stronger cravings and less stable appetite control. The category-based comparison further shows that cravings tend to decrease as sleep duration increases.
Overall, these findings indicate that sleep may be an important behavioral factor influencing both daily performance and eating patterns, which are critical for maintaining consistency in a weight-loss journey.
Activity, Mood & Productivity
=======================================================================
### Do higher step counts and workout minutes improve my mood and productivity?
Row
-----------------------------------------------------------------------
### Stepping Up!!!
```{r echo=FALSE}
valueBox(
value = format(round(avg_steps, 0), big.mark = ","),
caption = "Average Daily Steps",
icon = "fa-shoe-prints",
color = "green"
)
```
### Let's workout!!!
```{r}
valueBox(
value = paste0(avg_workout, " min"),
caption = "Average Workout Minutes",
icon = "fa-dumbbell",
color = "orange"
)
```
### How's the mood??
```{r}
valueBox(
value = avg_mood,
caption = "Average Mood Score",
icon = "fa-face-smile",
color = "blue"
)
```
Row {data-height=10}
-----------------------------------------------------------------------
This section examines whether higher daily movement and workout time are associated with better mood and productivity. Physical activity is an important part of both weight management and PCOS support, but its impact is not only physical.
Column
-----------------------------------------------------------------------
### Daily Steps and Mood
```{r}
ggplot(qs, aes(x = steps, y = mood_score, color = activity_level)) +
geom_point(size = 3, alpha = 0.85) +
geom_smooth(method = "lm", se = FALSE, linewidth = 1, color = "black") +
scale_color_manual(
values = c(
"Low Activity" = "#D32F2F",
"Moderate Activity" = "#1976D2",
"High Activity" = "#388E3C"
)
) +
labs(
x = "Daily Steps",
y = "Mood Score",
color = "Activity Level"
) +
theme_minimal() +
theme(
axis.title = element_text(size = 11),
legend.position = "top"
)
```
### Mood by Activity Level
```{r}
ggplot(qs, aes(x = activity_level, y = mood_score, fill = activity_level)) +
geom_boxplot(alpha = 0.85) +
scale_fill_manual(
values = c(
"Low Activity" = "#F28B82",
"Moderate Activity" = "#8AB4F8",
"High Activity" = "#81C995"
)
) +
labs(
x = "Activity Level",
y = "Mood Score",
fill = "Activity Level"
) +
theme_minimal() +
theme(
axis.title = element_text(size = 11),
legend.position = "none"
)
```
### Interactive View: Steps vs Productivity
```{r}
p_steps_productivity <- ggplot(qs, aes(
x = steps,
y = productivity_score,
color = activity_level,
text = paste(
"Date:", date,
"<br>Steps:", steps,
"<br>Productivity:", productivity_score,
"<br>Mood:", mood_score,
"<br>Workout Minutes:", workout_minutes,
"<br>Activity Level:", activity_level
)
)) +
geom_point(size = 3, alpha = 0.85) +
geom_smooth(method = "lm", se = FALSE, linewidth = 1, color = "black") +
scale_color_manual(
values = c(
"Low Activity" = "#D32F2F",
"Moderate Activity" = "#1976D2",
"High Activity" = "#388E3C"
)
) +
labs(
x = "Daily Steps",
y = "Productivity Score",
color = "Activity Level"
) +
theme_minimal() +
theme(
axis.title = element_text(size = 11),
legend.position = "top"
)
ggplotly(p_steps_productivity, tooltip = "text") %>%
layout(height = 350)
```
Row {data-height=100}
-----------------------------------------------------------------------
### Activity Insights
The results show a positive relationship between physical activity and both mood and productivity. Higher step counts are associated with improved mood scores, while low activity days tend to cluster around lower mood levels. The activity-level comparison further supports this, with high activity days showing consistently higher mood scores.
Productivity follows a similar pattern, where higher step counts align with higher productivity levels. Low activity days are associated with lower productivity, while moderate and high activity days show stronger performance.
Overall, these findings suggest that increased physical activity supports both emotional well-being and productivity, making it an important factor in maintaining consistency in a weight-loss and PCOS management routine.
Protein, Hunger & Snacking
=======================================================================
### How does protein intake influence hunger levels and snacking behavior?
This section examines whether higher protein intake is associated with lower hunger levels and reduced snacking behavior. Protein plays an important role in satiety and appetite control, which are especially relevant in a weight-loss journey and in managing eating patterns affected by PCOS.
Row
-----------------------------------------------------------------------
### Avg Protein
```{r echo=FALSE}
valueBox(
value = paste0(round(avg_protein, 0), " g"),
caption = "Average Protein Intake",
icon = "fa-apple-alt",
color = "orange"
)
```
### Hanngryy??
```{r}
valueBox(
value = avg_hunger,
caption = "Average Hunger Level",
icon = "fa-utensils",
color = "pink"
)
```
### Snacking
```{r}
valueBox(
value = paste0(snack_pct, "%"),
caption = "Days with Snacking",
icon = "fa-cookie-bite",
color = "purple"
)
```
Column
----------------------------------------------------------------------
### Protein Intake vs Hunger Level
```{r}
ggplot(qs, aes(x = protein_g, y = hunger_level, color = protein_category)) +
geom_point(size = 3, alpha = 0.85) +
geom_smooth(method = "lm", se = FALSE, linewidth = 1, color = "black") +
scale_color_manual(
values = c(
"Low Protein" = "#D32F2F",
"Moderate Protein" = "#1976D2",
"High Protein" = "#388E3C"
)
) +
labs(
x = "Protein Intake (g)",
y = "Hunger Level",
color = "Protein Category"
) +
theme_minimal() +
theme(
axis.title = element_text(size = 11),
legend.position = "top"
)
```
### Snacking Frequency by Protein Category
```{r}
ggplot(qs, aes(x = protein_category, fill = snacking)) +
geom_bar(position = "fill", alpha = 0.9) +
scale_fill_manual(
values = c(
"No" = "#66BB6A",
"Yes" = "#EF5350"
)
) +
labs(
x = "Protein Category",
y = "Proportion of Days",
fill = "Snacking"
) +
theme_minimal() +
theme(
axis.title = element_text(size = 11),
legend.position = "top"
)
```
### Grouped by protein intake
```{r}
ggplot(qs, aes(x = protein_category, y = hunger_level, color = protein_category)) +
geom_jitter(width = 0.15, size = 3, alpha = 0.8) +
stat_summary(fun = mean, geom = "point", size = 5, shape = 18, color = "black") +
scale_color_manual(
values = c(
"Low Protein" = "#D32F2F",
"Moderate Protein" = "#1976D2",
"High Protein" = "#388E3C"
)
) +
labs(
x = "Protein Category",
y = "Hunger Level",
color = "Protein Category"
) +
theme_minimal() +
theme(
axis.title = element_text(size = 11),
legend.position = "top"
)
```
Row {data-height=100}
-----------------------------------------------------------------------
### Protein Insights
The visualizations show a strong inverse relationship between protein intake and hunger levels. The scatter plot indicates that lower protein intake is consistently associated with higher hunger scores, while higher protein intake corresponds with lower and more stable hunger levels. This suggests that increasing protein intake may significantly improve satiety throughout the day.
The category-based comparison further reinforces this pattern. Low-protein days are clustered around higher hunger levels, while moderate-protein days show a noticeable reduction in hunger. High-protein days are associated with the lowest hunger levels and the least variability, indicating more consistent appetite control.
Overall, these findings highlight protein as a key nutritional factor in regulating hunger and reducing snacking behavior. For a weight-loss and PCOS management journey, maintaining adequate protein intake may support better appetite control, improve dietary consistency, and reduce the likelihood of overeating.
Carb-Dense Meals & Afternoon Crashes
=======================================================================
This section examines whether carb-dense meals are associated with afternoon energy crashes. For weight management and PCOS, meal composition can affect energy stability, cravings, and overall consistency throughout the day.
Row
-----------------------------------------------------------------------
### Carb-Dense Meal Days
```{r echo=FALSE}
carb_dense_pct <- round(mean(qs$carb_dense_meal == "Yes", na.rm = TRUE) * 100, 1)
valueBox(
value = paste0(carb_dense_pct, "%"),
caption = "Days with Carb-Dense Meals",
icon = "fa-cutlery",
color = "orange"
)
```
### Afternoon Crash Days
```{r}
crash_pct <- round(mean(qs$afternoon_crash == "Yes", na.rm = TRUE) * 100, 1)
valueBox(
value = paste0(crash_pct, "%"),
caption = "Days with Afternoon Crashes",
icon = "fa-bolt",
color = "red"
)
```
### Avg Energy
```{r}
valueBox(
value = avg_energy,
caption = "Average Energy Score",
icon = "fa-heartbeat",
color = "blue"
)
```
Column
-----------------------------------------------------------------------
### Afternoon Crashes Over Time
```{r}
ggplot(qs, aes(x = date, y = ifelse(afternoon_crash == "Yes", 1, 0), color = carb_dense_meal)) +
geom_point(size = 3, alpha = 0.9) +
geom_line(aes(group = 1), color = "gray60", linewidth = 0.8) +
scale_color_manual(values = c("No" = "#2E7D32", "Yes" = "#D84315")) +
scale_y_continuous(
breaks = c(0, 1),
labels = c("No Crash", "Crash")
) +
labs(
x = "Date",
y = "Afternoon Crash",
color = "Carb-Dense Meal"
) +
theme_minimal() +
theme(
axis.text.x = element_text(angle = 45, hjust = 1),
axis.title = element_text(size = 11),
legend.position = "top"
)
```
### Interactive View: Carb-Dense Meals vs Crashes
```{r}
p_crash <- ggplot(qs, aes(
x = carb_dense_meal,
y = cravings_level,
color = afternoon_crash,
text = paste(
"Date:", date,
"<br>Carb-Dense Meal:", carb_dense_meal,
"<br>Afternoon Crash:", afternoon_crash,
"<br>Energy Score:", next_day_energy,
"<br>Cravings Level:", cravings_level
)
)) +
geom_jitter(width = 0.2, size = 3, alpha = 0.85) +
scale_color_manual(values = c("No" = "#42A5F5", "Yes" = "#E53935")) +
labs(
x = "Carb-Dense Meal",
y = "Cravings Level",
color = "Afternoon Crash"
) +
theme_minimal() +
theme(
axis.title = element_text(size = 11),
legend.position = "top"
)
ggplotly(p_crash, tooltip = "text") %>%
layout(height = 350)
```
Row {data-height=100}
-----------------------------------------------------------------------
### Carb-Dense Meal Insights
The results show that carb-dense meals are associated with a higher likelihood of afternoon crashes. Crash events frequently occur on days with carb-heavy meals, while non-carb days are mostly linked with stable energy.
Cravings also tend to be higher on carb-dense meal days, suggesting a connection between energy crashes and increased appetite.
Overall, these findings indicate that carb-heavy meals may contribute to energy instability and stronger cravings, which can affect consistency in a weight-loss and PCOS management routine.
PCOS Symptoms & Cycle Impact
=======================================================================
### How do PCOS symptoms and cycle-related changes affect my daily habits and overall weight-loss consistency?
This section examines how cycle-related changes associated with PCOS influence daily habits, including energy, mood, cravings, and overall consistency. Hormonal fluctuations across different cycle phases can impact both physical and behavioral patterns, which may affect weight-loss progress and routine stability.
Row
-----------------------------------------------------------------------
### Cycle Phase
```{r}
valueBox(
value = most_common_phase,
caption = "Most Frequent Cycle Phase",
icon = "fa-calendar",
color = "purple"
)
```
### Energy Level
```{r}
valueBox(
value = avg_energy,
caption = "Average Energy",
icon = "fa-bolt",
color = "blue"
)
```
### Cravings
```{r}
valueBox(
value = avg_cravings,
caption = "Average Cravings",
icon = "fa-cutlery",
color = "orange"
)
```
Column
-----------------------------------------------------------------------
### Mood by Cycle Phase
```{r}
ggplot(qs, aes(x = cycle_phase, y = mood_score, fill = cycle_phase)) +
geom_boxplot(alpha = 0.85) +
labs(
x = "Cycle Phase",
y = "Mood Score"
) +
theme_minimal() +
theme(axis.text.x = element_text(angle = 20, hjust = 1))
```
### Energy by Cycle Phase
```{r}
ggplot(qs, aes(x = cycle_phase, y = next_day_energy, fill = cycle_phase)) +
geom_violin(alpha = 0.7) +
geom_boxplot(width = 0.1, fill = "white") +
labs(
x = "Cycle Phase",
y = "Energy Score"
) +
theme_minimal() +
theme(
axis.text.x = element_text(angle = 20, hjust = 1),
legend.position = "none"
)
```
### Cravings by Cycle Phase (Lollipop)
```{r}
cravings_summary <- qs %>%
group_by(cycle_phase) %>%
summarise(avg_cravings = mean(cravings_level, na.rm = TRUE))
ggplot(cravings_summary, aes(x = cycle_phase, y = avg_cravings)) +
geom_segment(aes(xend = cycle_phase, y = 0, yend = avg_cravings),
color = "gray60", linewidth = 1.5) +
geom_point(size = 6, color = "#D32F2F") +
labs(
x = "Cycle Phase",
y = "Average Cravings Level"
) +
theme_minimal() +
theme(axis.text.x = element_text(angle = 20, hjust = 1))
```
### Habit Consistency (Good Days) by Cycle Phase
```{r}
consistency_summary <- qs %>%
group_by(cycle_phase) %>%
summarise(good_day_pct = mean(good_day == "Yes") * 100)
ggplot(consistency_summary, aes(x = cycle_phase, y = good_day_pct, fill = cycle_phase)) +
geom_col(alpha = 0.85) +
labs(
x = "Cycle Phase",
y = "Good Day Percentage"
) +
theme_minimal() +
theme(axis.text.x = element_text(angle = 20, hjust = 1))
```
Row {data-height=100}
-----------------------------------------------------------------------
### PCOS & Cycle Insights
Cycle-related changes affect mood, energy, cravings, and overall consistency. Mood and energy are higher during the follicular and ovulatory phases, while they decline in the late luteal phase.
Cravings increase in the later phases, especially in the late luteal phase, where consistency is also lowest. In contrast, the ovulatory phase shows the highest consistency along with stronger mood and energy.
Overall, these patterns suggest that cycle-related fluctuations can impact daily habits and weight-loss consistency, with some phases being more supportive than others.
Conclusion
=======================================================================
Column
-----------------------------------------------------------------------
### Conclusion matrix
```{r}
cor_df <- as.data.frame(as.table(corr_matrix))
names(cor_df) <- c("Var1", "Var2", "Correlation")
ggplot(cor_df, aes(x = Var1, y = Var2, fill = Correlation)) +
geom_tile(color = "white") +
geom_text(aes(label = round(Correlation, 2)), size = 3) +
scale_fill_gradient2(
low = "#D32F2F",
mid = "white",
high = "#388E3C",
midpoint = 0,
limits = c(-1, 1)
) +
labs(
x = "",
y = "",
fill = "Correlation"
) +
theme_minimal() +
theme(
axis.text.x = element_text(angle = 45, hjust = 1),
panel.grid = element_blank()
)
```
### Conclusion
This dashboard applied a Quantified Self approach to understand how sleep, activity, nutrition, carb-dense meals, and cycle-related changes influence my PCOS and weight-loss journey. The correlation heatmap provides an integrated view of how these factors interact rather than acting independently.
The heatmap reinforces several key patterns observed throughout the dashboard. Sleep shows a positive relationship with energy and mood, while lower sleep is associated with higher cravings. Physical activity is positively linked with mood and productivity, supporting the role of movement in improving both mental and functional well-being.
Nutritional patterns are also clearly reflected. Protein intake shows a negative relationship with hunger and cravings, while carb-dense meals align with higher cravings and energy instability. These patterns support the earlier findings that meal composition plays an important role in appetite regulation and consistency.
Cycle-related variables show associations with mood, energy, and cravings, indicating that hormonal fluctuations may influence daily habits and weight-loss consistency. Phases with lower energy and higher cravings appear to align with reduced consistency.
Overall, the heatmap highlights that my weight-loss and PCOS journey is influenced by a network of interconnected factors. Rather than a single habit driving outcomes, it is the combination of sleep, activity, nutrition, and cycle-related changes that shapes consistency and progress. This reinforces the importance of taking a holistic and adaptive approach to managing both health and routine.
Row {data-height=100}
-------------------------------------
### References
<div class="References-card">
Business Review Live. (n.d.). 8 out of 10 women revealed that PCOS had affected their self-esteem and body image [Image]. https://businessreviewlive.com/8-out-of-10-women-revealed-that-pcos-had-affected-their-self-esteem-and-body-image-2/
Quantified Self. (n.d.). Quantified Self. http://quantifiedself.com/
Tufte, E. R. (2001). The visual display of quantitative information (2nd ed.). Graphics Press.
Wexler, S., Shaffer, J., & Cotgreave, A. (2017). The big book of dashboards. Wiley.
R Core Team. (2023). R: A language and environment for statistical computing. https://www.r-project.org/
Iannone, R., Allaire, J., & Borges, B. (2020). flexdashboard: R Markdown format for flexible dashboards. https://rmarkdown.rstudio.com/flexdashboard/
Wickham, H. (2016). ggplot2: Elegant graphics for data analysis. Springer.
Teede, H. J., et al. (2018). International evidence-based guideline for the assessment and management of polycystic ovary syndrome. Human Reproduction.
Leidy, H. J., et al. (2015). The role of protein in weight loss and maintenance. American Journal of Clinical Nutrition.
</div>