Overview
Develop a visualization dashboard based on a series of data about your own life. The actual data used for this project can range from daily sleep regimes, TV shows watched, types of food eaten, spending habits, commute times to work, travel habits, to blood pressure and nutrient intake. The amount of data you collect and harvest will differ based on your specified objectives.
Ultimately the project must meet certain key objectives: 1. You must provide an written summary of your data collection, analysis and visualization methods, including the why you chose your methods, and what tools you utilized. 2. Your summary must outline 5 questions that can be evaluated using a data-driven approach. These questions should be more than just “How many miles did I run”, although a couple of your questions could be stated that way. 3. You must collect, manage, and store the data necessary for this visualization. 4. You must design and create an appropriate set of visualizations (try not to use just one type of visualization) within a dashboard/storyboard that provides insight into your specified questions, with a minimum of > 1 interactive graphical element.
Introduction
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.
My Project Overview
Tracking credit card spendings is important for financial planning. As a management consultant, I make frequent travels that are work related. I get the opportunity to visit new places and try new restaurants around the city. By using my credit card for air and hotel expenses, I also manage to accrue points. Therefore, in this project, I aimed to analyze my spendings- the category of spendings, how often I use my credit card a month, patterns of specific spending categories and relationships among them.
Getting data
Using my credit card company’s statements, I could collect the data and export it as a cvs file. I transformed the data set that had some unwanted rows and columns. After cleaning the data, there are four data points remained: 1) Transaction Date 2) Category, and 3) Amount 4) Months between January and March 2023.
How often do I use my credit card each month?
The table gives a good summary as to how many transactions I’ve made using the credit card and in what categories. Looing at the table, I’ve made 22 transactions on an average every month till March. Therefore, I use my credit card approximately 73% a month to make different transactions
The month of March also had significant amount of transactions in terms of the amount spent, this can be attributed towards work related travel. This can also be seen from the bar graph taht shows more travel related expenditure in the month of March when compared to the other two months.Food and Drink related expenditures ahve remained consistent across all three months of the year.
Which category did I spend the most?
Majority of the expenditure has been spent on travel owing to my job as a consultant. Interestingly the next biggest pie is the credit card payment. Owing to the small sample size, that is only three months of analysis, I would still say that this is a pretty accurate representation of my credit card spending per year since I have a similar lifestyle for almost the majority part fo the year. Paying off credit card amount is also crucial and I am glad I do it at teh start of every month. This keeps me informed of my financial decisions better.
Is there a spending pattern?
The area chart below shows significant spikes in spending on “Credit crad payment” in March and a gradual increase in “Travel” from Jan to March. Owing to conference travels, I believe that the spike is justified. In the months of more travel, that is Jan and March we see more expenditures in food and drinks, which also seem justified.
Compare shopping and groceries expenses, is there any interesting pattern?
Each category has somewhat different spending patterns. For groceries, it fluctuates time to time. This means I did a grocery shopping at least once a week, which is pretty accurate. I spent the most on groceries during the month of Feb as I never travlled outside for any conference.
On the other hand, shopping is more interesting than my grocery spending pattern. When you take a look at the shopping chart, it looks like I didn’t spend much money for the whole of Feb and very little in Jan, however, it peaked in the month of March.
What does this mean? Grocery shopping tend to be fixed amount. Unless it’s family I’m spending for, it’s always only me eating the food. However, shopping is done time to time.
How was my spending habit in each category? Any interesting relationship?
In general, fixed costs such as groceries do not show much variability compared to shopping. Travel constitutes the majority fo the expense followed by shopping. Entertainment constitutes the next major expense. Gas, utility bills, personal, health & welness comprise of minor expenses which I do not believe will change for the remainder of the months of this year.
Based on the information provided, it seems that there are several opportunities to optimize spending and maximize rewards points for me personally as a management consultant.
One area to explore further is the “Travel” and “Food and Drinks” categories, as they appear to contribute significantly to high spending months. It may be worth reviewing these categories to see if there are any unnecessary expenses that could be reduced or eliminated to make sure I do not overspend during my travels. Given the higher expenditure in these categories, it might also be worth identifying specific offers and points that may be acrrued using my credit card over spending on these categories.
---
title: "ANLY512 Course Project"
output:
flexdashboard::flex_dashboard:
storyboard: true
orientation: columns
vertical_layout: fill
source: embed
---
```{r setup, include=FALSE}
library(flexdashboard)
```
-----------------------------------------------------------------------
### Instruction
**Overview**
Develop a visualization dashboard based on a series of data about your own life. The actual data used for
this project can range from daily sleep regimes, TV shows watched, types of food eaten, spending habits,
commute times to work, travel habits, to blood pressure and nutrient intake. The amount of data you collect
and harvest will differ based on your specified objectives.
Ultimately the project must meet certain key objectives:
1. You must provide an written summary of your data collection, analysis and visualization methods,
including the why you chose your methods, and what tools you utilized.
2. Your summary must outline 5 questions that can be evaluated using a data-driven approach.
These questions should be more than just “How many miles did I run”, although a couple of your
questions could be stated that way.
3. You must collect, manage, and store the data necessary for this visualization.
4. You must design and create an appropriate set of visualizations (try not to use just one type of
visualization) within a dashboard/storyboard that provides insight into your specified questions, with a
minimum of > 1 interactive graphical element.
**Introduction**
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.
**My Project Overview**
Tracking credit card spendings is important for financial planning. As a management consultant, I make frequent travels that are work related. I get the opportunity to visit new places and try new restaurants around the city. By using my credit card for air and hotel expenses, I also manage to accrue points. Therefore, in this project, I aimed to analyze my spendings- the category of spendings, how often I use my credit card a month, patterns of specific spending categories and relationships among them.
***
**Getting data**
Using my credit card company’s statements, I could collect the data and export it as a cvs file. I transformed the data set that had some unwanted rows and columns. After cleaning the data, there are four data points remained: 1) Transaction Date 2) Category, and 3) Amount 4) Months between January and March 2023.
```{r}
library(DT)
library(ggplot2)
library(dplyr)
library(dygraphs)
library(tidyverse)
library(lubridate)
data <- read.csv(file="C:/Users/rsudarsan/OneDrive - Strategic Analysis/Documents/ANLY512 Course Project Data_v1.csv")
data$Transaction.Date <- as.Date(data$Transaction.Date, format="%m/%d/%y")
```
-----------------------------------------------------------------------
### Question 1
How often do I use my credit card each month?
The table gives a good summary as to how many transactions I've made using the credit card and in what categories. Looing at the table, I've made 22 transactions on an average every month till March. Therefore, I use my credit card approximately 73% a month to make different transactions
The month of March also had significant amount of transactions in terms of the amount spent, this can be attributed towards work related travel. This can also be seen from the bar graph taht shows more travel related expenditure in the month of March when compared to the other two months.Food and Drink related expenditures ahve remained consistent across all three months of the year.
### Table
```{r}
data %>%
datatable()
```
### Month
```{r}
data$Transaction.Month.Year <- lubridate::floor_date(data$Transaction.Date, "month")
bar1 <- ggplot (data, aes(x = Transaction.Month.Year, fill = Category)) +
geom_bar() +
theme_bw() +
theme(axis.text.x=element_text(angle = -45, hjust = 0)) +
labs(title = "Credit Card Usage By Month",
x = "Month-Year",
y = "Count")
bar1
```
----------------------------------------------------------------------------------------
### Question 2
```{r}
# Basic piechart
bar2 <- ggplot(data, aes(x="Category", y = Amount, fill = Category)) +
geom_bar(stat="identity", width=1) +
theme_bw() +
labs(title = "Credit Card Usage By Category",
x = "Cateogry")
pie <- bar2 +
coord_polar("y", start = 0) +
theme(axis.text = element_blank(),
axis.ticks = element_blank(),
panel.grid = element_blank())
pie
```
***
Which category did I spend the most?
Majority of the expenditure has been spent on travel owing to my job as a consultant. Interestingly the next biggest pie is the credit card payment. Owing to the small sample size, that is only three months of analysis, I would still say that this is a pretty accurate representation of my credit card spending per year since I have a similar lifestyle for almost the majority part fo the year.
Paying off credit card amount is also crucial and I am glad I do it at teh start of every month. This keeps me informed of my financial decisions better.
-----------------------------------------------------------------------------
### Question 3
```{r}
data$new_date <- as.Date(data$Transaction.Date)
# Create a new data frame with the total spending for each category by month
spending_by_month <- aggregate(Amount ~ format(new_date, "%m"), data, sum)
colnames(spending_by_month) <- c("month", "amount")
# Create a new data frame with the total spending for each category by month and category
spending_by_category <- aggregate(Amount ~ Category + format(new_date, "%m"), data, sum)
colnames(spending_by_category) <- c("category", "month", "amount")
# Create the stacked area chart
ggplot(spending_by_category, aes(x = month, y = amount,fill = category, group = category)) +
geom_area(alpha = 0.7) +
scale_fill_brewer(palette="Set2")+
labs(x = "Month", y = "Amount", fill = "Category") +
ggtitle("Monthly Spending by Category") +
theme_bw()
```
***
Is there a spending pattern?
The area chart below shows significant spikes in spending on “Credit crad payment” in March and a gradual increase in "Travel" from Jan to March. Owing to conference travels, I believe that the spike is justified. In the months of more travel, that is Jan and March we see more expenditures in food and drinks, which also seem justified.
--------------------------------------------------------------------------------
### Question 4
Compare shopping and groceries expenses, is there any interesting pattern?
Each category has somewhat different spending patterns. For groceries, it fluctuates time to time. This means I did a grocery shopping at least once a week, which is pretty accurate. I spent the most on groceries during the month of Feb as I never travlled outside for any conference.
On the other hand, shopping is more interesting than my grocery spending pattern. When you take a look at the shopping chart, it looks like I didn't spend much money for the whole of Feb and very little in Jan, however, it peaked in the month of March.
What does this mean? Grocery shopping tend to be fixed amount. Unless it's family I'm spending for, it's always only me eating the food. However, shopping is done time to time.
### Grocery
```{r}
groceries <- data[data$Category == "Groceries", ]
ggplot(groceries, aes(x=Transaction.Date, y=Amount)) +
geom_line(color="#69b3a2", size=1, alpha=0.9, linetype=1) +
ggtitle("Groceries Spending From Jan 2023 to March 2023")
```
### Shopping
```{r}
shopping <- data[data$Category == "Shopping", ]
ggplot(shopping, aes(x=Transaction.Date, y=Amount)) +
geom_line(color="#FF5733", size=1, alpha=0.9, linetype=1) +
ggtitle("Shopping Spending From Jan 2023 to March 2023")
```
-----------------------------------------------------------------------------------
### Question 5
```{r}
ggplot(data, aes(x = Category, y = Amount, color = Category)) +
theme_bw() +
geom_boxplot() +
scale_fill_brewer(palette = 'Dark2') +
theme(axis.text.x=element_text(angle = -45, hjust = 0), legend.position = 'none') +
labs(subtitle = "How was my spending habit in each category?")
```
***
How was my spending habit in each category? Any interesting relationship?
In general, fixed costs such as groceries do not show much variability compared to shopping. Travel constitutes the majority fo the expense followed by shopping. Entertainment constitutes the next major expense. Gas, utility bills, personal, health & welness comprise of minor expenses which I do not believe will change for the remainder of the months of this year.
--------------------------------------------------------------------------------
### Conclusions and Insights
Based on the information provided, it seems that there are several opportunities to optimize spending and maximize rewards points for me personally as a management consultant.
One area to explore further is the "Travel" and "Food and Drinks" categories, as they appear to contribute significantly to high spending months. It may be worth reviewing these categories to see if there are any unnecessary expenses that could be reduced or eliminated to make sure I do not overspend during my travels. Given the higher expenditure in these categories, it might also be worth identifying specific offers and points that may be acrrued using my credit card over spending on these categories.