Hours Spent On Phone

Row

Row

Bedtime

Row

Row

Weekday Bedtimes

Weekend Bedtimes

Summary

Course Project for ANLY 512: Data Visualization

The Quantified Self

With the rise of technology, more and more devices and appliances have been made smart. The number of cell phones in use continue to increase, and it is being said that people are beginning to spend more and more time online, as there has been a decline in actual human interactions. I too have been guilty of that behavior, doing any and everything online; shopping, chatting, banking, just to mention a few.

The purpose of this analysis is to deep dive and get a better understanding of my online activities. It is important to note, however, that this data is pulled from my personal cell phone, not work cell phone, personal computer or work computer.

My cellphone is the device I use when I want to wind down. I do little to no work on it, and only use it for personal activities.

Definition of Variables:

Question 1: How much phone hours did I amass during this research period?

First and fore most, I was curious to know how much hours were really spent on the phone over the 12-week period. I have spent 298 hours on my cell phone, an average of 24 hours each week. Interpreted quite literally, out of the 7 days of the week, I spent an entire day on my cell phone. Mind you, this excluded time spent on my company computer, personal computer and online classes, and out of the 7 days in a week, I had already lost 1 day to cell phone usage.

Question 2: During the 12-week period, which Category did I spend the most time on?

This question is important since I spent a substantial amount of my weeks, on my phone as reveal in question 1. Getting a better understanding of what I spent those hours on will indicate if a lifestyle change is require. The charts reveal that I spent the most amount of time on activities that fall under the Productivity and Finance Category. This category consists of time spent on apps such as Teams, Mail, Slack, Banking apps, Weather, information and reading, and Calendar. Of all the 5 categories, this makes the most sense to spend the most time on. I spent a total of 115 hours on the apps, and while that is a lot of hours, I do believe is justified because its time spent on productivity apps. The second highest time was spent on the Social category. Now I would have been worried of I spent the most amount of time on social apps. Socializing is important, provided more time is not spent socializing than is spent on productivity. I spend the least amount of time on the creativity category, which makes sense because I do not take a lot of pictures or do much designing.

Question 3: What Percentage of hours is spent on each category?

It is one thing to discover that I spent the most time on one category, however, what proportion of my total phone time was spent on this category? As previously mentioned, the charts revealed that I spent the highest amount of time on the Productivity and Finance app. Upon further analysis, I found that on average I spent 9.5 hours each week on Productivity and Finance apps, max of 11.8 hours, and a min of 7.30 hours. This resulted in 38.6% of my total phone time being spent on Productivity and Finance app. I am fine with this However, I also found that I spent 27.9% on social apps. This is a high proportion of time spent on the social category. This indicates to me that there could be a need to reevaluate what apps I spent my phone time one. One average, I spent 7.40 hours on the social category each week, max of 10 hours and a min of 1.69 hours. Finding out that I only spend 10.2% of my time on Shopping & Food applications has been the highlight of my day, as this could be an indication that I do not spend as much time shopping as I thought I did, though it may require further analysis of my bank statement, total spend, and spend categories to confirm this. On average, I spent 2.57 hours on shopping and food category each week.

Question 4: What week had the highest phone usage?

Week 3 of my analysis had the highest phone usage, and this was driven by the increased amount of time spent on social apps and the other category. Out of all 12 weeks, I had the highest amount of time spent on the social category during week 3, with a total hour of 10.7 hours.

Question 5: Does the day of the week have any influence on my bedtime?

Since I was pulling phone data, another data that I could retrieve from my phone is the bedtime data. The bedtime data contains the time that I put down my phone, leaving the phone inactive for at least 3 hours. This according to my phone records indicates my bedtime. The data was split into weekday bedtime and weekend bedtime. The weekday bed is the bedtime before a weekday i.e. bed times recorded for Sunday, Monday, Tuesday, Wednesday and Friday nights. Weekend bedtimes are bedtimes recorded for Friday and Saturday nights. I always thought that the day of the week had no influence on my bedtime, but I could not be more wrong. I always assumed that I had a bedtime beyond which I naturally would fall asleep because I would not be able to get anything done. This analysis reveals that I have a much later bedtime on the weekend nights than I do on the weekday nights. As far as factors that influence this sleep time, I would need to do further research. At face value, my weekday bedtimes could be easily as a result of being exhausted from a long day at work or wanting to sleep earlier to ensure I get enough get hours of sleep.

---
title: "Course Project for ANLY 512: Data Visualization"
author: "M O"
date: "`r Sys.Date()`"
output:  
  flexdashboard::flex_dashboard:
    orientation: rows
    source_code: embed
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```


```{r  include=FALSE}

library(dplyr)
library(knitr)
library(kableExtra)
library(ggplot2)
library(readxl)
library(tidyr)
library(vcd)
library(devtools)
library(car)
library(plotly)
library(treemap)
library(reshape2)
```
# Hours Spent On Phone

Row  {data-height=400}
-------------------------------------

### 


```{r echo=FALSE}

Screen_time <- read_excel('12 Week Screen Time.xlsx')

Screen_time$Week <- factor(Screen_time$Week,
                           levels = c('Week 1', 'Week 2', 'Week 3', 'Week 4', 'Week 5', 'Week 6', 'Week 7', 'Week 8', 'Week 9', 'Week 10', 'Week 11', 'Week 12'))

Screen_time$Category <- factor(Screen_time$Category)


ggplot(Screen_time, aes(x = Category, y = Hours, fill = Category)) +
  theme_bw() +
  theme(legend.position = "none") +
  geom_boxplot() +
  labs(
    title = "Average Hours Spent on Category Per Week",
    x = "")




```



### 

```{r echo=FALSE}

Screen_time2<-
  Screen_time %>%
  select(Category, Hours) %>%
  group_by(Category) %>%
  summarise(Total_Hours = sum(Hours))

ggplot(Screen_time2, aes(fill= Category, y= Total_Hours, x= Category)) + 
  geom_bar( stat="identity") +
   geom_text(aes(label= round(Total_Hours, 2)), vjust=1.6, color="white", size=3.5) +
  theme_classic() +
  theme(legend.position="none") +
  labs(
    title = "Total hours Hours Spent by Category",
    y = 'Time (Hours)')




```



### 


```{r echo=FALSE}
Screen_time3<-
  Screen_time %>%
  select(Category, Hours) %>%
  group_by(Category) %>%
  summarise(Total_Hours = sum(Hours)) %>%
  mutate(Perc = Total_Hours/sum(Total_Hours)) %>%
  mutate(labels = scales::percent(Perc))



ggplot(Screen_time3, aes(x = "", y = Perc, fill = Category)) +
  geom_col(color = "white") +
  geom_label(aes(label = labels), color = c("white", "white", "white", "white", "white"),
            position = position_stack(vjust = 0.5),
            show.legend = FALSE) +
  coord_polar(theta = "y") + 
  theme_void() +
  labs(
    title = "Percentage of Hours Spent by Category")
  

```


Row {data-height=600}
-------------------------------------

### 

```{r echo=FALSE}

Screen_time <- read_excel('12 Week Screen Time.xlsx')

Screen_time$Week <- factor(Screen_time$Week,
                           levels = c('Week 1', 'Week 2', 'Week 3', 'Week 4', 'Week 5', 'Week 6', 'Week 7', 'Week 8', 'Week 9', 'Week 10', 'Week 11', 'Week 12'))

Screen_time$Category <- factor(Screen_time$Category)


plot2<- ggplot(Screen_time, aes(fill= Category, y= Hours, x = Week)) + 
  geom_bar(position="stack", stat="identity") +
  theme_classic() +
  theme(legend.position="none") +
  labs(
    title = "Weekly Hours Spent by Category",
    y = 'Time (Hours)',
    x = 'Weeks')

ggplotly(plot2)

```


### 

```{r echo=FALSE}


ggplot(Screen_time, aes(x = Week, y = Hours, fill = Week)) +
  theme_bw() +
  theme(legend.position = "none") +
  geom_boxplot() + coord_flip() +
  labs(
    title = "Average Hours Spent on The Phone Per Week",
    x = "")

ggplotly(p =  ggplot2:: last_plot())

```


# Bedtime

Row {data-height=400}
-------------------------------------


###

```{r echo=FALSE}

Sleep_time <- read_excel('12 Week Sleep Time.xlsx')


Sleep_timeWD <- 
  Sleep_time %>%
  select(Week, Days, Time) %>%
  group_by(Days) %>%
  filter(Days == "Sunday" |Days == "Monday" | Days == "Tuesday" | Days == "Wednesday" | Days == "Thursday") 


Sleep_timeWD$Week <- factor(Sleep_timeWD$Week,
                           levels = c('Week 1', 'Week 2', 'Week 3', 'Week 4', 'Week 5', 'Week 6', 'Week 7', 'Week 8', 'Week 9', 'Week 10', 'Week 11', 'Week 12'))

Sleep_timeWD$Days <- factor(Sleep_timeWD$Days,
                          levels = c('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday'))

ggplot(Sleep_timeWD, aes(x = Days, y = Time, fill = Days)) +
  theme_bw() +
  theme(legend.position = "none") +
  geom_boxplot() +
  labs(
    title = "Average Weekday Bedtime",
    x = "")

ggplotly(p =  ggplot2:: last_plot())
```

###

```{r echo=FALSE}


Sleep_timeWE <- 
  Sleep_time %>%
  select(Week, Days, Time) %>%
  group_by(Days) %>%
  filter(Days == "Friday" | Days == "Saturday") 

Sleep_timeWE$Week <- factor(Sleep_timeWE$Week,
                           levels = c('Week 1', 'Week 2', 'Week 3', 'Week 4', 'Week 5', 'Week 6', 'Week 7', 'Week 8', 'Week 9', 'Week 10', 'Week 11', 'Week 12'))


ggplot(Sleep_timeWE, aes(x = Days, y = Time, fill = Days)) +
  theme_bw() +
  theme(legend.position = "none") +
  geom_boxplot() +
  labs(
    title = "Average Weekday Bedtime",
    x = "",
    y = "Time (AM)")

ggplotly(p =  ggplot2:: last_plot())

```



Row {data-height=600 .tabset .tabset-fade}
-------------------------------------

### Weekday Bedtimes

```{r echo=FALSE}


ggplot(Sleep_timeWD, aes(Week, Time, colour = Days, group = Days)) +
  geom_line() +
  theme_minimal() +
  theme(legend.key.height= unit(0.1, 'cm'),
        legend.key.width= unit(0.1, 'cm')) +
  labs(
    x = 'Weeks)',
    y = 'Bed Time',
    title = 'Weekday Bedtimes')
  
ggplotly(p =  ggplot2:: last_plot())
```

### Weekend Bedtimes

```{r echo=FALSE}


ggplot(Sleep_timeWE, aes(Week, Time, colour = Days, group = Days)) +
  geom_line() +
  theme_minimal() +
  labs(
    x = 'Weeks)',
    y = 'Bed Time',
    title = 'Weekend Bedtimes')
  
ggplotly(p =  ggplot2:: last_plot())
```



# Summary

**Course Project for ANLY 512: Data Visualization**

**The Quantified Self**

 * Data Source: **Mobile Phone**
 * Data Type: **Time spent oh phone data, and Bedtime data**
 
With the rise of technology, more and more devices and appliances have been made smart. The number of cell phones in use continue to increase, and it is being said that people are beginning to spend more and more time online, as there has been a decline in actual human interactions. I too have been guilty of that behavior, doing any and everything online; shopping, chatting, banking, just to mention a few.

The purpose of this analysis is to deep dive and get a better understanding of my online activities. It is important to note, however, that this data is pulled from my personal cell phone, not work cell phone, personal computer or work computer.

My cellphone is the device I use when I want to wind down. I do little to no work on it, and only use it for personal activities.

**Definition of Variables:**

 * Social: This the amount of time spent on social applications, such as Instagram, WhatsApp and the Message app.
 8* Productivity and Finance: This according to the iPhone app is categorized as time spent on apps such as Microsoft Teams, Mail, Slack, Banking apps, Weather, information and reading, and Calendar.
 * Creativity: Time spent on photos and camera, or any applications used for designing
 * Shopping and food: Time spent on shopping apps such as Walmart, Amazon, and any other shopping applications
 * Other: Time spent on any applications that do not fall under the above-mentioned categories
For the purpose of the project, I retrieved a 12-week data, from the start of the semester to the end of the semester. I wanted to gain insight into not only how much time I have spent on my phone, but what I spend the time doing.

**Question 1: How much phone hours did I amass during this research period?**

First and fore most, I was curious to know how much hours were really spent on the phone over the 12-week period. I have spent 298 hours on my cell phone, an average of 24 hours each week. Interpreted quite literally, out of the 7 days of the week, I spent an entire day on my cell phone. Mind you, this excluded time spent on my company computer, personal computer and online classes, and out of the 7 days in a week, I had already lost 1 day to cell phone usage.

**Question 2: During the 12-week period, which Category did I spend the most time on?**

This question is important since I spent a substantial amount of my weeks, on my phone as reveal in question 1. Getting a better understanding of what I spent those hours on will indicate if a lifestyle change is require. The charts reveal that I spent the most amount of time on activities that fall under the Productivity and Finance Category. This category consists of time spent on apps such as Teams, Mail, Slack, Banking apps, Weather, information and reading, and Calendar. Of all the 5 categories, this makes the most sense to spend the most time on. I spent a total of 115 hours on the apps, and while that is a lot of hours, I do believe is justified because its time spent on productivity apps. The second highest time was spent on the Social category. Now I would have been worried of I spent the most amount of time on social apps. Socializing is important, provided more time is not spent socializing than is spent on productivity. I spend the least amount of time on the creativity category, which makes sense because I do not take a lot of pictures or do much designing.

**Question 3: What Percentage of hours is spent on each category?**

It is one thing to discover that I spent the most time on one category, however, what proportion of my total phone time was spent on this category? As previously mentioned, the charts revealed that I spent the highest amount of time on the Productivity and Finance app. Upon further analysis, I found that on average I spent 9.5 hours each week on Productivity and Finance apps, max of 11.8 hours, and a min of 7.30 hours. This resulted in 38.6% of my total phone time being spent on Productivity and Finance app. I am fine with this
However, I also found that I spent 27.9% on social apps. This is a high proportion of time spent on the social category. This indicates to me that there could be a need to reevaluate what apps I spent my phone time one. One average, I spent 7.40 hours on the social category each week, max of 10 hours and a min of 1.69 hours.
Finding out that I only spend 10.2% of my time on Shopping & Food applications has been the highlight of my day, as this could be an indication that I do not spend as much time shopping as I thought I did, though it may require further analysis of my bank statement, total spend, and spend categories to confirm this. On average, I spent 2.57 hours on shopping and food category each week.

**Question 4: What week had the highest phone usage?**

Week 3 of my analysis had the highest phone usage, and this was driven by the increased amount of time spent on social apps and the other category. Out of all 12 weeks, I had the highest amount of time spent on the social category during week 3, with a total hour of 10.7 hours.

**Question 5: Does the day of the week have any influence on my bedtime?**

Since I was pulling phone data, another data that I could retrieve from my phone is the bedtime data. The bedtime data contains the time that I put down my phone, leaving the phone inactive for at least 3 hours. This according to my phone records indicates my bedtime. The data was split into weekday bedtime and weekend bedtime. The weekday bed is the bedtime before a weekday i.e. bed times recorded for Sunday, Monday, Tuesday, Wednesday and Friday nights. Weekend bedtimes are bedtimes recorded for Friday and Saturday nights.
I always thought that the day of the week had no influence on my bedtime, but I could not be more wrong. I always assumed that I had a bedtime beyond which I naturally would fall asleep because I would not be able to get anything done.
This analysis reveals that I have a much later bedtime on the weekend nights than I do on the weekday nights. As far as factors that influence this sleep time, I would need to do further research. At face value, my weekday bedtimes could be easily as a result of being exhausted from a long day at work or wanting to sleep earlier to ensure I get enough get hours of sleep.