I have chosen the two most important aspects of my life to develop this dashboard: Personal Spending Habits and Health:
Health Data: I have been using a smart-scale Fitindex® that records weight, BMI, visceral fat, protein percentage, and metabolic age. I imported this data for past 1.5 years from the app and cleaned it for developing this dashboard. I also used iPhone health app to record my walking and running activity.
Spending Data: I imported and merged credit card spendings across all my accounts and categorized them into either of the following 6 categories: Dining, Travel, Shopping, Transport, Groceries, and Health & Fitness.
Questions addressed in this dashboard:
Q1 - What does my spending look like over the last 6 months?
Q2 - Where does most of my paycheck go - which category is my top spend?
Q3 - What type of Credit Card Rewards would I benefit the most from?
Q4 - Do I spend less on eating out when I am making food at home more often?
Q5 - How much has my weight fluctuated over the past 1.5 Years?
Q6 - Does a more active lifestyle help me shed more KGs?
Q1 - What does my spending look like over the last 6 months?
The stacked barchart shows my total credit card spending over the last six months. The colors break down my spending in each month into the six categories: - Dining - Groceries - Health and Fitness - Shopping - Transport - Travel
I can see that my overall credit card spend was about 1K a month which halfed in August and September, only to bounce back up to 1.5K in the holiday shopping season. This could be the result of spending more due to thanks-giving sales, buying presents, etc.
Q2 - Where does most of my paycheck go - which category is my top spend?
I built a pie chart for the entire consolidated spending across all credit cards, and across the entire 6 months, in order to see my biggest spending category. The chart shows that Shopping beats all other categories and makes up 35% of my total spending, followed by Dining which constitutes 26.8% of my spending.
This might be because I signed up for a rewards card for shopping, that might have nudged me to shop more as I was thinking of earning more cashback on it
Q3 - What type of Credit Card Rewards would I benefit the most from?
This could be inferred from the pie-chart in question 2. As per the pie-chart, my first option should opt for a credit card that gives the most rewards on shopping stores like Banana Republic, Ann Taylor, Gap, etc.
However, since I already have a shopping rewards card, I would probably benefit the most from a dining-rewards credit card like Uber eats.
Q4 - Do I spend less on eating out when I am making food at home more often?
An Interactive line plot was built to see both spending categories on the same plot: Grocery and Dining out spend so that they could be compared.
Theory
I spend less in the months when I am making food at home more often.
Assumtion
This question assumes that most of my grocery spend translates to cooking more at home.
Result - Is the theory supported?
The theory holds true for the first four months: - As we go from June through August, I can see that my spend on groceries has increased more and my eating out expenses have plunged to just about a $150 a month (almost half of what I was spending on eating out!) - As we go from August to September, I can see a decline in grocery spending and a simultaneous increase in eating out spend.
So far the results corroborate the theory. However, the spendings for October and onwards, do not support our theory: both expenses rise and fall simultaneously in last two months.
Aside from the last two anomolous months, we can conclude that our theory holds:
I do spend less in the months when I am making food at home more often.
Q5 - How much has my weight fluctuated over the past 1.5 Years?
I have built an interactive barchart over a time of 1.5 years to look at the fluctuations in my weight in KGs.
Observations:
Inference:
Q6 - Does a more active lifestyle help me shed more KGs?
I have plotted the relationship between my weight gain (in Kgs) against my walking activity (in miles) to see whether a more active lifestyle actually does help me shed more KGs or not.
The regression line shows a decreasing trend which corroborates my theory. Although there is a huge confidence interval, yet it does seem like walking more helps me keep my weight low as well.
---
title: "Storyboard - Personal Health and Spending"
output:
flexdashboard::flex_dashboard:
social: menu
source: embed
orientation: columns
# vertical_layout: fill
horizontal_layout: fill
# runtime: shiny
# runtime: shiny_prerendered
# rmarkdown:: render
---
```{r}
### Load Required Packages and Datasets
library(datasets)
library(ggplot2)
library(readxl)
library(dplyr)
library(flexdashboard)
library(plotly)
library(ggthemes)
SpendData <- read_excel("C:/Users/ayekhan/Desktop/HU/Data Vis/Project/SpendData.xlsx")
SpendData2 <- read_excel("C:/Users/ayekhan/Desktop/HU/Data Vis/Project/SpendData2.xlsx")
SpendData3 <- read_excel("C:/Users/ayekhan/Desktop/HU/Data Vis/Project/SpendData3.xlsx")
SpendTotal <- read_excel("C:/Users/ayekhan/Desktop/HU/Data Vis/Project/SpendTotal.xlsx")
HealthData <- read_excel("C:/Users/ayekhan/Desktop/HU/Data Vis/Project/HealthData.xlsx")
HealthData2 <- read_excel("C:/Users/ayekhan/Desktop/HU/Data Vis/Project/HealthData2.xlsx")
#Set theme:
theme_my <- function(base_size=14, base_family="Times New Roman") {
theme_foundation() +
theme(plot.title = element_text(face = "bold",
size = rel(1.2), hjust = 0.5),
text = element_text(),
panel.background = element_blank(),
plot.background = element_blank(),
panel.border = element_blank(),
axis.title = element_text(face = "bold",size = rel(1)),
axis.title.y = element_text(angle=90,vjust =2),
axis.title.x = element_text(vjust = -0.2),
axis.text = element_text(),
axis.line = element_line(colour="black"),
axis.ticks = element_line(),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
legend.key = element_rect(colour = 'transparent'),
legend.position = "bottom",
legend.direction = "horizontal",
strip.background=element_rect(colour="#f0f0f0",fill="#f0f0f0"),
strip.text = element_text(face="bold")
)
}
theme_mybasic <- theme(
plot.title = element_text(face = "bold", size = rel(1.2), hjust = 0.5),
text = element_text(),
panel.background = element_blank(),
plot.background = element_blank(),
panel.border = element_blank(),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
legend.key = element_rect(colour = 'transparent'),
legend.position = "bottom",
legend.direction = "horizontal",
strip.background=element_rect(colour="#f0f0f0",fill="#f0f0f0"),
strip.text = element_text(face="bold"))
```
Introduction
================================
Column {data-width=100}
-------------------------------------
***
I have chosen the two most important aspects of my life to develop this dashboard: Personal Spending Habits and Health:
- Health Data: I have been using a smart-scale Fitindex® that records weight, BMI, visceral fat, protein percentage, and metabolic age. I imported this data for past 1.5 years from the app and cleaned it for developing this dashboard. I also used iPhone health app to record my walking and running activity.
- Spending Data: I imported and merged credit card spendings across all my accounts and categorized them into either of the following 6 categories: Dining, Travel, Shopping, Transport, Groceries, and Health & Fitness.
**Questions addressed in this dashboard:**
Q1 - What does my spending look like over the last 6 months?
Q2 - Where does most of my paycheck go - which category is my top spend?
Q3 - What type of Credit Card Rewards would I benefit the most from?
Q4 - Do I spend less on eating out when I am making food at home more often?
Q5 - How much has my weight fluctuated over the past 1.5 Years?
Q6 - Does a more active lifestyle help me shed more KGs?
Q1-Q3 - Spending Overview
================================
Column{data-width=400}
-----------------------------------------------------------------------
```{r}
# Stacked Bar Chart
ggplot(SpendData2, aes(x=BillingPeriod, y=Amount, color=Category, fill=Category))+geom_col(position="stack")+
labs(title="Q1 - Spending over Last 6 Months",x="Billing Period",y="Expenses (in USD)")+
theme_my()
```
Column{data-width=400}
-----------------------------------------------------------------------
```{r}
# Piechart
ggplot(SpendTotal, aes(x="", y=Spend, fill=Category))+
geom_bar(width = 1, stat = "identity")+
coord_polar(theta="y")+
theme_void()+
geom_text(aes(label = scales::percent(Spend/sum(Spend))), position = position_stack(vjust = 0.5))+
labs(title="Q2 - Total Spend by Category")+
theme_mybasic
```
Column{data-width=200}
-----------------------------------------------------------------------
***
**Q1 - What does my spending look like over the last 6 months?**
The stacked barchart shows my total credit card spending over the last six months. The colors break down my spending in each month into the six categories:
- Dining
- Groceries
- Health and Fitness
- Shopping
- Transport
- Travel
*I can see that my overall credit card spend was about 1K a month which halfed in August and September, only to bounce back up to 1.5K in the holiday shopping season. This could be the result of spending more due to thanks-giving sales, buying presents, etc.*
**Q2 - Where does most of my paycheck go - which category is my top spend?**
I built a pie chart for the entire consolidated spending across all credit cards, and across the entire 6 months, in order to see my biggest spending category. The chart shows that Shopping beats all other categories and makes up 35% of my total spending, followed by Dining which constitutes 26.8% of my spending.
*This might be because I signed up for a rewards card for shopping, that might have nudged me to shop more as I was thinking of earning more cashback on it*
**Q3 - What type of Credit Card Rewards would I benefit the most from?**
This could be inferred from the pie-chart in question 2. As per the pie-chart, my first option should opt for a credit card that gives the most rewards on shopping stores like Banana Republic, Ann Taylor, Gap, etc.
*However, since I already have a shopping rewards card, I would probably benefit the most from a dining-rewards credit card like Uber eats.*
Q4 - Grocery Spending vs Eating Out
================================
Column {data-width=400}
-------------------------------------
```{r}
#Spending vs Eating Trend
EatData2<-ggplot(data = SpendData3)+
geom_line(aes(x=BillingPeriod,y=Amount,color=Category))+
geom_point(aes(x=BillingPeriod,y=Amount,color=Category))+
labs(title="Q4 - Grocery Spending and Eating Out \nTrends over Last 6 Months",
x="Billing Period",y="Spend (in USD)")+
theme_my()
ggplotly(EatData2)
```
Column{data-width=600}
-----------------------------------------------------------------------
***
**Q4 - Do I spend less on eating out when I am making food at home more often?**
An Interactive line plot was built to see both spending categories on the same plot: Grocery and Dining out spend so that they could be compared.
***Theory***
I spend less in the months when I am making food at home more often.
***Assumtion***
This question assumes that most of my grocery spend translates to cooking more at home.
***Result - Is the theory supported?***
The theory holds true for the first four months:
- As we go from June through August, I can see that my spend on groceries has increased more and my eating out expenses have plunged to just about a $150 a month (almost half of what I was spending on eating out!)
- As we go from August to September, I can see a decline in grocery spending and a simultaneous increase in eating out spend.
So far the results corroborate the theory. However, the spendings for October and onwards, do not support our theory: both expenses rise and fall simultaneously in last two months.
*Aside from the last two anomolous months, we can conclude that our theory holds:*
***I do spend less in the months when I am making food at home more often.***
Q5 & Q6 - Health Overview
================================
Column {data-width=400}
-------------------------------------
```{r}
#Interactive Weight Barchart:
WeightPlots<-ggplot(data = HealthData)+
geom_col(aes(x=Time,y=Weight),size = 1,fill="Grey")+
geom_point(aes(x=Time,y=Weight),color="Orange",size=3)+
labs(title="Q5 - Weight Fluctuations over last 1.5 Years",x="Time",y="Weight (in KGs)")+
theme_my()
ggplotly(WeightPlots)
```
Column {data-width=350}
-------------------------------------
```{r}
#Weight vs Activity
ggplot(data=HealthData,aes(x=Weight,y=Miles))+geom_point()+geom_smooth(method="lm")+
labs(title="Q6 - Miles Walked vs Weight",x="Weight in KGs",y="Miles Walked")+
theme_my()
```
Column{data-width=250}
-----------------------------------------------------------------------
***
**Q5 - How much has my weight fluctuated over the past 1.5 Years?**
I have built an interactive barchart over a time of 1.5 years to look at the fluctuations in my weight in KGs.
*Observations:*
- My weight has stayed in the range of 46.3 to 49.25 KGs
- It has slightly increased over the past year
- The lowest weight that I had was 46.3 Kg in October 2018
- The highest weight that I has was 49.25Kgs in August of this year.
*Inference:*
- When I was a student, during 2018, I was more active, and hence my weight was low.
- August this year I was travelling a lot and hence, I was not sticking to a healthier diet or lifestyle due to a desk job, hence the gain in weight.
**Q6 - Does a more active lifestyle help me shed more KGs?**
I have plotted the relationship between my weight gain (in Kgs) against my walking activity (in miles) to see whether a more active lifestyle actually does help me shed more KGs or not.
The regression line shows a decreasing trend which corroborates my theory. Although there is a huge confidence interval, yet it does seem like walking more helps me keep my weight low as well.