Overview of the Quantified Self movement

quant_self

quant_self


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.

For this project, I collected the data from my apple watch as well as the Health app in my iPhone. The data covers the period from November 2018 - April 2020.

Working on this project we will be looking into answering the following questions: 1. How is my average heart rate over the last few years? 2. How is my average step count on a weekly basis? Is there a particular day of the week where it is highest and what day is it? 3. Analyze my active energy burned over the last few years. 4. How did the current “Stay at home” situation impacted my walking/running distance? In which month did I walk/run the most in the last few years? 5. Analyse the flights climed data over the last few years.


Q1: Heart Rate Analysis


I collected the heart rate data from my apple watch and Health app from 11/2018 - 04/2020. From the plot, I see that the average heart rate is OK. However it peaked during the month of March, 2020. It is interesting that I lost my apple watch and didn’t use it for about 6 months in 2019 and the plot shows that.

Q2: Step Count Analysis


In the first plot, I see that my average step count in 2018 is clearly more than that of 2019 and 2020. So I need to work on that. We can also notice that it decreased drastically from March 2020 to April 2020 because of the stay at home situation right now. From the second plot, I learnt that my average step count on saturdays is little more thant the other days. I got the step count data from the Health app in my phone so we can see that there’s no loss of data because of the apple watch as we noticed in the “Heart Rate” plot.

Q3: Active Energy Analysis


From the above plot, I can say that my total energy burned looks pretty much the same in 2018 and 2019 but slightly decreased in 2020. May be because of lockdown?

Q4: Walking/Running Distance Analysis


I averaged about 40-50 miles every month with walking/running distance. It looks like the distance covered in December 2018 is the highest compared to other months over the last years. Again, we can notice that the April 2020 bar is the shortest because of the current “stay at home” situation.

Q5: Flights Climbed Analysis


I usually avoid the elevator and take the stairs at my work place. We can see my flights climbing pattern is pretty much the same over the last few years and the highest was in October 2019. However there is a decrese in the months of March and April 2020 as I am working form home during that period.

Conclusion

From the visualizations, I tried to find the answers for the following questions below.

  1. How is my average heart rate over the last few years?

  2. How is my average step count on a weekly basis? Is there a particular day of the week where it is highest and what day is it?

  3. Analyze my active energy burned over the last few years.

  4. How did the current “Stay at home” situation impacted my walking/running distance? In which month did I walk/run the most in the last few years?

  5. Analyse the flights climed data over the last few years.

Conclusion The analysis show some of my health patterns over the past few years and how some factors (like lockdown etc.) impacted my health conditions. It was clearly evident that the stay at home situation impacted my “Active Energy Burned”, “Step Count” and “Walking/Running Distance”. I also noticed where I need to focus to improve my overall health.

---
title: "ANLY 512 Final Project"
author: "Sindhura Arigela"
output: 
  flexdashboard::flex_dashboard:
    storyboard: true
    social: menu
    source: embed
    orientation: columns
    vertical_layout: fill
---

```{r setup, include=FALSE}
library(flexdashboard)
library(knitr)
library(ggplot2)
library(tidyverse)
library(dplyr)
library(lubridate)
library(XML)

xml <- xmlParse("export.xml")
summary(xml)
df <- XML:::xmlAttrsToDataFrame(xml["//Record"])

df$endDate <-ymd_hms(df$endDate,tz="UTC")
df$month<-format(df$endDate,"%m")
df$year<-format(df$endDate,"%Y")
df$date<-format(df$endDate,"%Y-%m-%d")
df$dayofweek <-wday(df$endDate, label=TRUE, abbr=FALSE)
df$hour <-format(df$endDate,"%H")
df$value <- as.numeric(as.character(df$value))

```

### Overview of the Quantified Self movement
![quant_self](how-to-use-apple-health-main2_thumb800.png)

***
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.

For this project, I collected the data from my apple watch as well as the Health app in my iPhone. The data covers the period from November 2018 - April 2020.

Working on this project we will be looking into answering the following questions:
1. How is my average heart rate over the last few years?
2. How is my average step count on a weekly basis? Is there a particular day of the week where it is highest and what day is it?
3. Analyze my active energy burned over the last few years.
4. How did the current "Stay at home" situation impacted my walking/running distance? In which month did I walk/run the most in the last few years? 
5. Analyse the flights climed data over the last few years. 

***

### Q1: Heart Rate Analysis
```{r}
heart_rate <- df %>%
  filter(type == 'HKQuantityTypeIdentifierHeartRate') %>%
  group_by(date,year,month) %>%
  summarize(hr=mean(value)) 
heart_rate$date <- as.Date(heart_rate$date,"%Y-%m-%d")

ggplot(heart_rate,aes(x=date, y=hr, group=year)) + 
  geom_line(aes(colour=year))+ xlab("Month-Year") + ylab("Average Heart Rate") +
  ggtitle("Average Heart Rate over the last few years") +
  scale_x_date(date_labels = "%b-%Y") +
  theme(plot.title = element_text(hjust = 0.5))
```

***
I collected the heart rate data from my apple watch and Health app from 11/2018 - 04/2020. From the plot, I see that the average heart rate is OK. However it peaked during the month of March, 2020. It is interesting that I lost my apple watch and didn't use it for about 6 months in 2019 and the plot shows that. 

### Q2: Step Count Analysis

```{r}

steps <- df %>%
  filter(type == 'HKQuantityTypeIdentifierStepCount') %>%
  group_by(date,year,month) %>%
  summarize(steps=sum(value))

steps$date <- as.Date(steps$date,"%Y-%m-%d")

ggplot(steps,aes(x=date, y=steps, group=year)) + 
  geom_line(aes(colour=year))+
  geom_smooth(se=F)+
  ggtitle("Total Steps (2018-2020)")+
  xlab("Month-Year") +
  ylab("Total Step Count") +
  scale_x_date(date_labels = "%b-%Y") +
  theme(plot.title = element_text(hjust = 0.5)) 

step_count <- df %>%
  filter(type == 'HKQuantityTypeIdentifierStepCount') %>%
  filter(year==2019) %>% 
  group_by(dayofweek,year,month) %>%
  summarize(step_count=mean(value))

ggplot(step_count,aes(x=month, y=step_count, group=dayofweek)) + 
  geom_line(aes(colour=dayofweek),size=1.5)+
  theme_minimal()+
  xlab("Month") +
  ylab("Average Step Count") +
  ggtitle("Average Step Count On a Weekly Basis") +
  theme(plot.title = element_text(hjust = 0.5))
```

***
In the first plot, I see that my average step count in 2018 is clearly more than that of 2019 and 2020. So I need to work on that. We can also notice that it decreased drastically from March 2020 to April 2020 because of the stay at home situation right now. From the second plot, I learnt that my average step count on saturdays is little more thant the other days. I got the step count data from the Health app in my phone so we can see that there's no loss of data because of the apple watch as we noticed in the "Heart Rate" plot.

### Q3: Active Energy Analysis

```{r}

energy <- df %>%
  filter(type == 'HKQuantityTypeIdentifierActiveEnergyBurned') %>%
  group_by(date,year,month) %>%
  summarize(energy_burned=sum(value))

energy$date <- as.Date(energy$date,"%Y-%m-%d")

ggplot(energy,aes(x=date, y=energy_burned, group=year)) + 
  geom_line(aes(colour=year))+
  xlab("Month-Year") +
  ylab("Energy Burnt") +
  ggtitle("Total Active Energy Burned") +
  scale_x_date(date_labels = "%b-%Y") +
  theme(plot.title = element_text(hjust = 0.5))
```

***
From the above plot, I can say that my total energy burned looks pretty much the same in 2018 and 2019 but slightly decreased in 2020. May be because of lockdown?

### Q4: Walking/Running Distance Analysis

```{r}
df %>%
  filter(type == 'HKQuantityTypeIdentifierDistanceWalkingRunning') %>%
  group_by(year,month) %>%
  summarize(distance=sum(value)) %>%
  ggplot(aes(x=month, y=distance, fill=year)) + 
  geom_bar(position='dodge', stat='identity') +
  scale_y_continuous(labels = scales::comma) +
  xlab("Month") +
  ylab("Distance (miles)") +
  ggtitle("Total Walking/Running Distance (2018-2020")  +
  theme(plot.title = element_text(hjust = 0.5))


```

***
I averaged about 40-50 miles every month with walking/running distance. It looks like the distance covered in December 2018 is the highest compared to other months over the last years. Again, we can notice that the April 2020 bar is the shortest because of the current "stay at home" situation.



### Q5: Flights Climbed Analysis

```{r}
 df %>%
  filter(type == 'HKQuantityTypeIdentifierFlightsClimbed') %>%
  group_by(year,month) %>%
  summarize(flights=sum(value)) %>%
  
  ggplot(aes(x=month, y=flights, fill=year)) + 
  geom_bar(position='dodge', stat='identity') +
  scale_y_continuous(labels = scales::comma) +
  theme(panel.grid.major = element_blank())+
  ggtitle("Total flights climbed") +
  xlab("Month") +
  ylab("Total Flights") +
  ggtitle("Total Flights Climbed (2018-2020") +
  theme(plot.title = element_text(hjust = 0.5))
```

***
I usually avoid the elevator and take the stairs at my work place. We can see my flights climbing pattern is pretty much the same over the last few years and the highest was in October 2019. However there is a decrese in the months of March and April 2020 as I am working form home during that period.

### Conclusion

From the visualizations, I tried to find the answers for the following questions below. 

1. How is my average heart rate over the last few years?

2. How is my average step count on a weekly basis? Is there a particular day of the week where it is highest and what day is it?

3. Analyze my active energy burned over the last few years.

4. How did the current "Stay at home" situation impacted my walking/running distance? In which month did I walk/run the most in the last few years? 

5. Analyse the flights climed data over the last few years. 

**Conclusion**
The analysis show some of my health patterns over the past few years and how some factors (like lockdown etc.) impacted my health conditions. It was clearly evident that the stay at home situation impacted my "Active Energy Burned", "Step Count" and "Walking/Running Distance". I also noticed where I need to focus to improve my overall health.