The Quantified Self (QS) is a movement motivated to leverage the synergy of wearables, analytics, and “Big Data”. This movement exploits the ease and convenience of data acquisition through the internet of things (IoT) to feed the growing obsession of personal informatics and quotidian data. The website http://quantifiedself.com/ is a great place to start to understand more about the QS movement.
The value of the QS for our class is that its core mandate is to visualize and generate questions and insights about a topic that is of immense importance to most people – themselves. It also produces a wealth of data in a variety of forms. Therefore, designing this project around the QS movement makes perfect sense because it offers you the opportunity to be both the data and question provider, the data analyst, the vis designer, and the end user. This means you will be in the unique position of being capable of providing feedback and direction at all points along the data visualization/analysis life cycle.
Develop a visualization dashboard based on a series of data about my own life. The primary objective of this project is to analyze and visualize patterns and trends in personal monthly spending over the past 12 months using R Studio, in order to gain insights and develop actionable strategies for improved financial management. Through the creation of a dashboard utilizing the flexdashboard package, the project aims to present a comprehensive summary of the data exploration process, leading to the development of at least four pertinent questions or ideas that can guide future financial decision-making and optimize spending habits.
Identify the patterns and trends of my monthly spending in the past 12 months.
Collect and clean my spending data to prepare for data exploration.
Design and create at least five visualizations using R Studio to explore my data and present the information. The visualizations could include line charts to show trends over time, bar charts to show categories of spending, scatterplots to show correlations between variables, or any other appropriate visualization types.
Organize the visualizations into a dashboard using the flexdashboard package in R Studio. The dashboard should present my path of data exploration and provide a clear and concise summary of the insights I discovered.
Develop at least four questions or ideas based on my visualizations, such as “What is my average daily spending?” or “Are there any categories of spending where I consistently overspend?” These questions or ideas will help guide my future financial management decisions.
Q1: What’s the trend of monthly spending over the past 12 months?
Q2: What is the largest spending category each month?
Q3: What is the percentage of each category in Jan 2023, Feb 2023 and March 2023 respectively?
Q4: How did the largest spending category change over time in absolute term (Comparison with total spending)?
Q5: What could be the savings assuming $9,000 monthly after tax income?
Question 1: Q1: What’s the trend of monthly spending over the past 12 months?
Summary: Monthly Spending Is Relatively Stable Between $2,500 & $3,000.
Question 2: What is the largest spending category each month?
Summary: The Largest Spending Category Is Food & Drink Each Month
Question 3: What is the percentage of each category in Jan 2023, Feb 2023 and March 2023 respectively?
Summary: Food & Beverage accounted for 76%, 71% and 68% of total spending in Jan 2023, Feb 2023 and March 2023 respectively.
Question 4: How did the largest spending category change over time in absolute term (Comparison with total spending)?
Summary: Food & Beverage spending has been relatively stable in absolute term over the past 12 months. The has been more volatility in the total spending, which was not drivend by the change of Food & Beverage spending.
`
Question 5: What could be the savings assuming $9,000 monthly after tax income?
Summary 5 Assuming $9,000 monthly after tax income, the monthly savings is estimated at around $6,000 per month.
After analyzing and visualizing the monthly spending data, several insights have been uncovered which can help guide future financial management decisions:
The monthly spending remained relatively stable between $2,500 and $3,000 over the past 12 months, indicating a consistent spending pattern.
The largest spending category each month was Food & Drink, which should be considered when planning budgets or identifying areas for potential savings.
The proportion of spending on Food & Beverage has been gradually decreasing over the first quarter of 2023, accounting for 76%, 71%, and 68% of total spending in January, February, and March 2023, respectively.
Despite the slight decrease in Food & Beverage’s proportion of spending, the absolute spending on this category has remained relatively stable over the past 12 months, suggesting that the overall changes in total spending were not driven by fluctuations in Food & Beverage expenses.
Assuming a $9,000 monthly after-tax income, the estimated monthly savings are around $6,000. This information can be used to set saving goals or plan for future investments.
There are more room to allocate a fixed monthly budget for discretionary spending: To better manage overall expenses, consider setting a fixed monthly budget for discretionary spending, which includes non-essential items or activities such as entertainment, dining out, and shopping.
---
title: "ANLY-512 Course Project"
author: "Kai Mei"
date: "`r Sys.Date()`"
output:
flexdashboard::flex_dashboard:
orientation: rows
social: menu
source: embed
vertical_layout: fill
html_document:
df_print: paged
pdf_document: default
---
# **Overview**
Row {data-height=230}
-------------------------------------
### **Incentive**
The Quantified Self (QS) is a movement motivated to leverage the synergy of wearables, analytics, and
“Big Data”. This movement exploits the ease and convenience of data acquisition through the internet
of things (IoT) to feed the growing obsession of personal informatics and quotidian data. The website
http://quantifiedself.com/ is a great place to start to understand more about the QS movement.
The value of the QS for our class is that its core mandate is to visualize and generate questions and insights
about a topic that is of immense importance to most people – themselves. It also produces a wealth of data
in a variety of forms. Therefore, designing this project around the QS movement makes perfect sense because
it offers you the opportunity to be both the data and question provider, the data analyst, the vis designer,
and the end user. This means you will be in the unique position of being capable of providing feedback and
direction at all points along the data visualization/analysis life cycle.
Row
-------------------------------------
### **Project Objective**
Develop a visualization dashboard based on a series of data about my own life. The primary objective of this project is to analyze and visualize patterns and trends in personal monthly spending over the past 12 months using R Studio, in order to gain insights and develop actionable strategies for improved financial management. Through the creation of a dashboard utilizing the flexdashboard package, the project aims to present a comprehensive summary of the data exploration process, leading to the development of at least four pertinent questions or ideas that can guide future financial decision-making and optimize spending habits.
### **Project Data & Method**
Identify the patterns and trends of my monthly spending in the past 12 months.
Collect and clean my spending data to prepare for data exploration.
Design and create at least five visualizations using R Studio to explore my data and present the information. The visualizations could include line charts to show trends over time, bar charts to show categories of spending, scatterplots to show correlations between variables, or any other appropriate visualization types.
Organize the visualizations into a dashboard using the flexdashboard package in R Studio. The dashboard should present my path of data exploration and provide a clear and concise summary of the insights I discovered.
Develop at least four questions or ideas based on my visualizations, such as “What is my average daily spending?” or “Are there any categories of spending where I consistently overspend?” These questions or ideas will help guide my future financial management decisions.
### **Five Questions to Investigate**
Q1: What's the trend of monthly spending over the past 12 months?
Q2: What is the largest spending category each month?
Q3: What is the percentage of each category in Jan 2023, Feb 2023 and March 2023 respectively?
Q4: How did the largest spending category change over time in absolute term (Comparison with total spending)?
Q5: What could be the savings assuming $9,000 monthly after tax income?
```{r setup, include=FALSE}
library(flexdashboard)
library(knitr)
library(ggplot2)
library(lubridate)
library(viridis)
library(scales)
library(chron)
library(grid)
library(gridExtra)
library(readxl)
library(tidyverse)
```
```{r}
data = read_excel("/Users/kevinmei/Desktop/Harrisburg/data.xlsx")
```
# **Question 1**
Row {data-height=100}
-------------------------
### **summary**
Question 1: Q1: What's the trend of monthly spending over the past 12 months?
Summary: Monthly Spending Is Relatively Stable Between $2,500 & $3,000.
Column {data-width=200}
-------------------------------------
### Monthly Spending Data Over Last 12 Months
```{r}
Monthly_total <- data[data$Category == "Monthly total",]
g1 <- ggplot(Monthly_total, aes(Time, Amount)) +
geom_col(fill = "blue") +
theme_classic() +
labs(x="Month", y="Monthly Total Spending")
g1
```
# **Question 2**
Row {data-height=100}
-------------------------
### **summary**
Question 2: What is the largest spending category each month?
Summary: The Largest Spending Category Is Food & Drink Each Month
Column {.tabset}
-------------------------------------
### Proportion of Spending by Category Over Last 12 Months
```{r}
Category_spending <- data[data$Category != "Monthly total",]
g2 <- ggplot(Category_spending, aes(fill=Category, y=Amount, x=Time)) +
theme_classic() +
theme(axis.text.x = element_blank()) +
geom_bar(position="fill", stat="identity") +
scale_fill_viridis(discrete = TRUE) +
labs(x="May 2022 to April 2023 Monthly Data", y="Monthly Total Spending")
g2
```
# **Question 3**
Row {data-height=100}
-------------------------
### **summary**
Question 3: What is the percentage of each category in Jan 2023, Feb 2023 and March 2023 respectively?
Summary: Food & Beverage accounted for 76%, 71% and 68% of total spending in Jan 2023, Feb 2023 and March 2023 respectively.
Column {.tabset}
-------------------------------------
### Proportion of Spending by Category in Jan 2023
```{r}
Jan_2023 <- Category_spending[Category_spending$Time == '2023-01',]
Jan_2023$Percent <- round(Jan_2023$Amount / sum(Jan_2023$Amount),2)
pie1 <- ggplot(Jan_2023, aes(x = "", y=Percent, fill = Category)) +
geom_col(color = "black") +
coord_polar(theta = "y") +
geom_text(aes(label = Percent),
position = position_stack(vjust = 0.5)) +
scale_fill_brewer(palette = "Pastel1") +
theme_void()
pie1
```
### Proportion of Spending by Category in Feb 2023
```{r}
Feb_2023 <- Category_spending[Category_spending$Time == '2023-02',]
Feb_2023$Percent <- round(Feb_2023$Amount / sum(Feb_2023$Amount),2)
pie2 <- ggplot(Feb_2023, aes(x = "", y=Percent, fill = Category)) +
geom_col(color = "black") +
coord_polar(theta = "y") +
geom_text(aes(label = Percent),
position = position_stack(vjust = 0.5)) +
scale_fill_brewer(palette = "Pastel1") +
theme_void()
pie2
```
### Proportion of Spending by Category in March 2023
```{r}
Mar_2023 <- Category_spending[Category_spending$Time == '2023-03',]
Mar_2023$Percent <- round(Mar_2023$Amount / sum(Mar_2023$Amount),2)
pie3 <- ggplot(Mar_2023, aes(x = "", y=Percent, fill = Category)) +
geom_col(color = "black") +
coord_polar(theta = "y") +
geom_text(aes(label = Percent),
position = position_stack(vjust = 0.5)) +
scale_fill_brewer(palette = "Pastel1") +
theme_void()
pie3
```
# **Question 4**
Row {data-height=100}
-------------------------
### **summary**
Question 4: How did the largest spending category change over time in absolute term (Comparison with total spending)?
Summary: Food & Beverage spending has been relatively stable in absolute term over the past 12 months. The has been more volatility in the total spending, which was not drivend by the change of Food & Beverage spending.
Column {.tabset}
-------------------------------------
### Food and Drink Spending Over Time vs Total Spending
```{r}
Monthly_FB <- data[data$Category == "Food & drink",]
p1=ggplot(Monthly_FB, aes(factor(Time), Amount)) +
geom_point(color = "#F7756D", size = 2)+
theme_classic() +
labs(x = "", y = "Food & Beverage")
p2=ggplot(Monthly_total, aes(factor(Time), Amount)) +
geom_point(color = "#00AFBB", size = 2)+
theme_classic() +
labs(x = "", y = "Total Spending")
grid.arrange(p1, p2, ncol = 1)
```
`
# **Question 5**
Row {data-height=100}
-------------------------
### **summary**
Question 5: What could be the savings assuming $9,000 monthly after tax income?
Summary 5 Assuming $9,000 monthly after tax income, the monthly savings is estimated at around $6,000 per month.
Column {.tabset}
-------------------------------------
### Proportion of Spending by Category in 2022
```{r}
Monthly_total$Saving <- 9000 - Monthly_total$Amount
ggplot(Monthly_total, aes(x=Time, y=Saving)) +
geom_segment(aes(x=Time, xend=Time, y=0, yend=Saving), color="skyblue") +
geom_point( color="blue", size=4, alpha=0.6) +
theme_light() +
coord_flip() +
theme(
panel.grid.major.y = element_blank(),
panel.border = element_blank(),
axis.ticks.y = element_blank()
) +
labs(x = "", y = "Monthly Savings")
```
# **Conclusion & Insights**
-------------------------------------
After analyzing and visualizing the monthly spending data, several insights have been uncovered which can help guide future financial management decisions:
The monthly spending remained relatively stable between $2,500 and $3,000 over the past 12 months, indicating a consistent spending pattern.
The largest spending category each month was Food & Drink, which should be considered when planning budgets or identifying areas for potential savings.
The proportion of spending on Food & Beverage has been gradually decreasing over the first quarter of 2023, accounting for 76%, 71%, and 68% of total spending in January, February, and March 2023, respectively.
Despite the slight decrease in Food & Beverage's proportion of spending, the absolute spending on this category has remained relatively stable over the past 12 months, suggesting that the overall changes in total spending were not driven by fluctuations in Food & Beverage expenses.
Assuming a $9,000 monthly after-tax income, the estimated monthly savings are around $6,000. This information can be used to set saving goals or plan for future investments.
There are more room to allocate a fixed monthly budget for discretionary spending: To better manage overall expenses, consider setting a fixed monthly budget for discretionary spending, which includes non-essential items or activities such as entertainment, dining out, and shopping.