STUDY

In this Study 51 large and small mammals were followed. Biological data of the 51 mammals were collected in 5 areas of: body weight, brain weight, lifespan, gestation period, and total sleep time. The following questions 1 - 10 were asked.

Data

The Data is in this study found at this link: Mammals

Data Set Names

## Data Set Names are mammals, large mammals (lmam), and small mammals (smam)
## We call up the data as follows:
library(readr)
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
mammals <-read.csv("https://www.dropbox.com/s/d5dnxumbwm13xjs/mammals.csv?dl=1", header=T)
smam <- filter(mammals, bodywt < 100)
lmam <- filter(mammals, bodywt >= 100)

Question 1: What is the average gestation period for all mammals?

View(mammals)
attach(mammals)
mean(gestation) 
## [1] 142.0686

**Answer: The mean gestation period for all mammals is 142.0686 days.

Question 2. What is the median gestation period for all mammals?

median(gestation)
## [1] 100

**The median gestation period for all mammals is 100 days.

Question 3. Histogram and boxplot presentation for all mammals.Are there any outliers?

hist(gestation, col = "purple") #Q3

boxplot(gestation, main="All Mammals Gestation Period", horizontal=TRUE, col="lightblue",pch=16, cex=2, xlab="Number of Days")

**Answer From the histogram we see there are outliers and a right skew. We confirm this with a boxplot showing the skew and two outlier points.

Question 4. Which is more spread out, body weight or brain weight?

range(brainwt) 
## [1]    0.14 5712.00
range(bodywt) 
## [1]    0.005 6654.000

** Answer: Bodyweight is more spread out from comparing the largest number and its distance from the smallest number. ## Question 5 Horizontal boxplots for total sleep, lifespan, and gestation are presented together. Which of these variables are the most symmetric?

boxplot(totalsleep, main="Total Sleep Time All Mammals",horizontal=TRUE, col = "lightblue", pch=16, cex=2, xlab="Number of Days") 

boxplot(lifespan, main="LifeSpan All Mammals", horizontal = TRUE, col = "lightblue", pch=16, cex=2, xlab="Number of Days") 

boxplot(gestation, main="All Mammals Gestation Period", horizontal=TRUE, col="lightblue",pch=16, cex=2, xlab="Number of Days")

mean(totalsleep)
## [1] 10.34902
mean(lifespan)
## [1] 20.14706

**Answer: From looking at the boxplots we see that total sleep is most symmetric.

Questions 6 and 7 Mammals were filtered into two groups: Mammals weighing < 100kg titled smam and Mammals weighing >= 100kg titled lmam.

smam <- filter(mammals, bodywt < 100)
View(smam)  
lmam <- filter(mammals, bodywt >= 100)
View(lmam) 

Question 8 A scatterplot of the gestation vs. total sleep for large mammals is presented. Comment on the type of association. Find the correlation coefficient of the gestation and total sleep for large mammals.

plot(lmam$gestation, lmam$totalsleep, main = "Sleep Needed for Large Mammal Gestation", col="lightblue4", pch=16, cex=1.25, ylab="gestation", xlab="Number of Days")  

cor(lmam$gestation, lmam$totalsleep) 
## [1] -0.6591753

**Answer: A correlation coefficient of -0.659 confirms that there is a midweight negative association between total sleep and gestation for large mammals.

Question 9 Which sleeps more, small mammals or large mammals?

mean(lmam$totalsleep)
## [1] 6.055556
mean(smam$totalsleep)
## [1] 11.26905

**Answer: Taking the average or mean of large and small mammals, we find that on average, small mammals have a higher average sleep time. Small mammals sleep an average of 11.27 while large mammals sleep an average of 6.056.

Question 10 A scatterplot of the body weight vs. brain weight for small mammals is presented. There appears to be a data point that is very different from the others (this is called an influential point). Which mammal does this point correspond to?

plot(smam$bodywt,smam$brainwt, main = "Small Mammal Brain Weight to Body Weight",col="lightblue4", pch=16, cex=1.25, ylab= "Brain Weight", xlab= "Body Weight")

**Answer: The influential point is the upper most brain weight point corresponding to the upper most point. This influential point corresponds to the Human.