Flipped Assignment #3

The data used on this assignment is retrieved from a raw github file. The data contains the beats and temperature of males and females. In the data a ‘1’ in the gender column represents a male and a ‘2’ represents a female. Entries 1 through 65 are males and entries 66 through 130 are females

dat<-read.csv("https://raw.githubusercontent.com/tmatis12/datafiles/main/normtemp.csv")

males<-dat[1:65,3]
females <- dat[66:130,3]

Question 1

Male Stats

# Males Stats
summary(males)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   58.00   70.00   73.00   73.37   78.00   86.00
sd(males)
## [1] 5.875184
hist(males, main = "Males Beat Histogram", col = "blue", xlab = "Male Beats")

qqnorm(males, main = "Male Beat Normal Probability Plot")

When looking at the the stats we see that the mean is greater than the median by 0.37.

The data appears to be normally distributed. At first glance it appears to be following a straight line. However when looking at the histogram shows that hearts beat ranging from 70 to 75 beats occurs more frequently among men, compared to women who do If we were to put a a curve over the histogram it would appear to look there is slight skewness. This is because the historgram is not symmetric. Lastly, not many men have heart beats ranging from 55 to 60 or 85 to 90. In a way, they can be perceived as outliers.

Female Stats

summary(females)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   57.00   68.00   76.00   74.15   80.00   89.00
sd(females)
## [1] 8.105227
hist(females, main= "Female Beat Histogram", col = "pink", xlab = "Female Beats")

qqnorm(females, main = "Female Beat Normal Probability Plot")

In the case of the feamle entries, the median is greater than the mean by 2.15. This is more significant than the males 0.37.

Like the men statisitc, the probability plot appears to follow a straight line, which means it is normally distributed. However, according to the female histogram, the 65 to 75 Beats have the same frequency level. There does not appear to be any outliers in the case of females heartbeat.This gives it a slight skewness but not as significat as the mens. This can be because there is one more female entry than there is man.

Question 2

Boxplot

boxplot(males, females, main = " Male vs Female Boxplot",names = c( "Male", "Female" ))

Comparitive Notes for Boxplot

Females, have a higher interquartiles range compared to males. We see this in the box width. Furthermore, females have a higher max and a lower mean. This means that their heartbeats beat faster and slower compared to males. Lastly, the females average heart beat is higher than males. This can all be corroborated with the previous stats. Although the IQR of the two box plots are different the whiskers appear to be similar lengths.

All Code

dat<-read.csv("https://raw.githubusercontent.com/tmatis12/datafiles/main/normtemp.csv") #this reads in the data from the raw github file

#this separate males and females
males<-dat[1:65,3] 
females <- dat[66:130,3]

#male statistics
summary(males)
sd(males)
hist(males, main = "Males Beat Histogram", col = "blue", xlab = "Male Beats")
qqnorm(males, main = "Male Beat Normal Probability Plot")

#female statics
summary(females)
sd(females)
hist(females, main= "Female Beat Histogram", col = "pink", xlab = "Female Beats")
qqnorm(females, main = "Female Beat Normal Probability Plot")

#Comparative Box plot
{r boxplot diagram, echo = TRUE}
boxplot(males, females, main = " Male vs Female Boxplot",names = c( "Male", "Female" ))