data = read.csv("DATA1001/DATA1001files/Data1001/Data/SleepInMammals.csv")
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 3.4.4
Slowwave = data$Slow.wave.sleep..hrs.day.
Paradoxical = data$Paradoxical.sleep..hrs.day.
Brainweight = data$Brain.Weight..g.
Bodyweight = data$Body.Weight..kg.
TotalSleep = data$Total.sleep..hrs.day.
Lifespan = data$Maximum.life.span..years.

Classification

Species of Animal - Factor (Categorical, Nominal)
Body Weight (kg) - Numerical, Continuous
Brain Weight (g) - Numerical, Continuous
Slow Wave Sleep (hrs/day) - Numerical, Continuous
Paradoxical Sleep (hrs/day) - Numerical, Continuous
Total Sleep (hrs/day) - Numerical, Continuous
Maximum Life Span (Years) - Numerical, Continuous
Gestation Time (Days) - Numerical, Discrete
Predation Index - Categorical, Ordinal
Sleep Exposure Index - Categorical, Ordinal
Overall Danger Index - Categorical, Ordinal

Summary of Dataset

This study presents the physiological and ecological variables in relationship with sleep patterns in 39 different mammal species. Sleep is divided generally into slow wave (non-dreaming) and paradoxical (dreaming) activity. The indexes is a form of rating from 1-5 (1 being low, 5 being high). There are multiple connections which can be drawn by comparing variables and their effect on each other

Source

“Science” (T Allison, Dv Cicchetti) (Vol 194, Issue 4266 - 12 November 1976)
Data inserted into (https://gist.github.com/yppmark/d907dc265a84cac76ba7)
from "Science" (T Allison, Dv Cicchetti)
Professor of Clinical Psychology, Dv Cicchetti and scientific author T Allison teamed up to produce the education book “Science”. Within this contains the data set used for this project. Origins of the data have come from Dv Cicchetti and her team at the American Association for the Advancement of Science (AAAS). Over a period of several years, they observed and monitored the behaviour and sleep of 39 different mammals. The AAAS are known as the world’s largest general scientific society, and have been responsible for the publication of hundreds of scientific novels and documents, making them extremely reputable in their contribution to scientific knowledge. Thus coming from such a reputable nationwide association, this data set is extremely reliable.

Stakeholders

This dataset is extremely relevant and useful for a wide range of both individuals and groups including:
Veterinarians: This data enables veterinarians to gain higher understanding of mammals, in particular how exposure to different environments can affect the occurrence of either paradoxical or slow wave sleep. It can also be useful in the development of different treatments specifically to preserve certain ecosystems (if animals aren’t sleeping appropriately, they are likely to suffer physically and mentally, risking endangerment or extinction).
Evolutionary Biologist: This information and its respective conclusions allow evolutionary biologists to compare this data with similar past or present data sets, allowing trends/patterns and diversity to be observed among mammals. The conclusions can reveal a range of evolutionary patterns including ecological, psychological and behavioural trends.
Doctors/Sleep Analysis: similar to veterinarians, doctors and sleep analysis researchers are able to use this data to gain a deeper understanding of how human sleeping patterns compare with various other mammals. This is crucial in developing conclusions regarding human sleep concepts and thus in the development of future medicine and treatments.
General Public: The general public may use the information out of interest or for their own personal research purposes.

Thus this data set is extremely necessary for any occupation involved in sleep research and treatments

Slow Wave vs Paradoxical Sleep - Which is more prevalent in Mammals?

An overview

par(mfrow = c(1,2))
boxplot(Slowwave, horizontal = T, xlab = "Average Slow Wave Sleep (hrs/day)", main = "Slow Wave Sleep", col = c('indianred2'))
boxplot(Paradoxical, horizontal = T, xlab = "Average Paradoxical Sleep (hrs/day)", main = "Paradoxical Sleep", col = c('lightblue')) 

Lets take a deeper look…

boxplot(Slowwave, horizontal = T, xlab = "Average Slow Wave Sleep (hrs/day)", main = "Slow Wave Sleep", col = c('indianred2'))

Numerical Summary - Slow Wave Sleep

Mean
mean(Slowwave)
## [1] 8.915
Median
median(Slowwave)
## [1] 8.85
Summary
summary(Slowwave)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   2.100   6.300   8.850   8.915  11.000  17.900
boxplot(Paradoxical, horizontal = T, xlab = "Average Paradoxical Sleep (hrs/day)", main = "Paradoxical Sleep", col = c('lightblue')) 

Numerical Summary - Slow Wave Sleep

Mean
mean(Paradoxical)
## [1] 1.96
Median
median(Paradoxical)
## [1] 1.8
summary(Slowwave)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   2.100   6.300   8.850   8.915  11.000  17.900
summary(Paradoxical)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    0.00    0.90    1.80    1.96    2.45    6.60
Conclusion: On average mammals have almost 4.5x more Slow Wave sleep than Paradoxical sleep. Some animals also do not experience any Paradoxical sleep at all. There is also a much larger range and interquartile range when looking at Slowwave sleep. (IQR - 4.7 vs 1.06, Overall - 15.8 vs 6.6)

Does an increase in brain weight affect the amount of slow wave and paradoxical sleep?

SlowwaveSleep.hrs = data$Slow.wave.sleep..hrs.day.
BrainWeight.g = data$Brain.Weight..g.
p1 = ggplot(data, aes(x = BrainWeight.g, y = SlowwaveSleep.hrs))
p1 + geom_point(aes(colour=SlowwaveSleep.hrs))

ParadoxicalSleep.hrs = data$Paradoxical.sleep..hrs.day.
BrainWeight.g = data$Brain.Weight..g.
p2 = ggplot(data, aes(x = BrainWeight.g, y = ParadoxicalSleep.hrs))
p2 + geom_point(aes(colour=ParadoxicalSleep.hrs))

Conclusion: As brain weight increases, slow wave sleep somewhat decreases and paradoxical sleep somewhat increases. Further study is needed in the form of a larger sample size of animals, with varying brain weight to determine if the increase of brainweight affects slow wave and paradoxical sleep

Does the total sleep of a mammal affect it’s lifespan?

TotalSleep.hrs = data$Total.sleep..hrs.day.
Lifespan.yrs = data$Maximum.life.span..years.
p2 = ggplot(data, aes(x = TotalSleep.hrs, y = Lifespan.yrs))
p2 + geom_point(aes(colour = Lifespan))

Conclusion: The graph shows a spread out set of data with no particular trend. Hence the total sleep of a mammal has minimal connection to its life span. However, a majority of the select mammals live below 25 years with total sleep widely ranging from 8 to 20 hours/day. Humans have total sleep of around 7-8hrs with a much higher lifespan (100yrs)

What is the affect of bodyweight on lifespan?

barplot(Lifespan, sort(Bodyweight), xlab = "Bodyweight(kg)", ylab = "Lifespan(yrs)", main = "Lifespan of Mammals")

Numerical Summary

summary(Lifespan)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   2.000   4.925  12.500  20.015  27.250 100.000
summary(Bodyweight)
##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
##    0.005    0.260    2.250  105.746   14.828 2547.000
#The median and mean are quite far apart showing outliers in the data with a large body weight
Conclusion: Both the graph and the summary suggest that the smaller a mammal is, the longer it’s lifespan. This is seen by the fact that the graph is positively skewed. The comparision of summaries between the ‘Body Weight’ and ‘Lifespan’ of the mammals also suggests a correlation between the two (majroity of the body weights are smaller and majority of the lifespans are larger)