Not long ago, I start to realize that my husband seems snore a lot at night, what’s the worse, it impacts on his breathing system and my sleeping status. In order to take a closer look on how serious his snore situation, I record his snore status by using an Iphone application called SnoreLab.

In this project, I try to analyze five questions as below.

  1. Is a positive relationship between Quiet time and Time in Bed can be observed?
  2. Is a negative relationship between Loud time and Time in Bed can be observed?
  3. What is the relationship between snore score and Time in Bed?
  4. Does Date impacts on Snore Score and Time in Bed?
  5. What is contribution of Quiet time to Snore%?

After a week of recording, I collected raw data from SnoreLab. I utilized several functions in ggplot, including geom_jitter,geom_area, geom_point, geom_raster and geom_bar, to visualize data I recorded.

library(ggplot2)
Snore <- read.csv('/Users/ming/Desktop/Final\ Project\ Data\ Set.csv')
ggplot(Snore, aes(x=Bed.Time, y=Quiet.Time)) + geom_jitter(aes(fill=Quiet.Time))

ggplot(Snore, aes(x=Bed.Time, y=Loud.Time)) + geom_area(size=4)

ggplot(Snore, aes(x=Bed.Time, y=Snore.Score)) + geom_point(aes(color=Snore.Score)) + geom_smooth(method = 'lm')

ggplot(Snore, aes(x=Date, y=Snore.Score, z=Bed.Time)) + geom_raster(aes(fill = Bed.Time), hjust=0.5,vjust=0.5,interpolate=FALSE)

ggplot(Snore, aes(x=Quiet.Time, y=Snoring..)) + geom_point(stat="identity")

After read data visualization, I found out that, 1. Quiet time is definitely positive related to Time in Bed; 2. Loud time and Snore Score are negatively related to Time in Bed. 3. There is no certain pattern between Bed.Time, snoring score and Date; 4. Quiet.Time is not the only variable that impacts on snoring % as I see different snoring % under the same Quiet.Time.

Final Dashboard Presenting as below.

Column

Chart A

ggplot(Snore, aes(x=Bed.Time, y=Loud.Time)) + geom_area(size=4)

Column

Chart B

ggplot(Snore, aes(x=Bed.Time, y=Snore.Score)) + geom_point(aes(color=Snore.Score)) + geom_smooth(method = 'lm')

Chart C

ggplot(Snore, aes(x=Date, y=Snore.Score, z=Bed.Time)) + geom_raster(aes(fill = Bed.Time), hjust=0.5,vjust=0.5,interpolate=FALSE)