Male Heart rate

Male Heart Rate Descriptive

For males, the resting heart rate ranges from 58 to 86 beats per minute, with a sample mean of 73.37 beats per minute and a median of 73 beats per minute. The first quartile is 70 and the third quartile is 78, meaning that the middle 50% of the male resting heart rates are between 70 and 78 beats per minute. The sample standard deviation is 5.88, which indicates that the observations are relatively close to the mean.

Max :  86
Min :  58
Mean :  73.36923
Standard Deviation : 5.875184
Median : 73
Quartiles : 58 70 73 78 86

Male Heart Rate Histogram

The histogram shows that most of the male resting heart rates are concentrated around the low to mid-70s. There do not appear to be any extremely unusual observations.

Male Heart Rate Normal Probability Plot

The normal probability plot shows the observations following the reference line reasonably well. Therefore, the male resting heart rate distribution appears to be approximately normal, although there may be some small deviations from the line at the lower and upper ends.

Female Heart Rate

Female Heart Rate Descriptive

For females, the resting heart rate ranges from 57 to 89 beats per minute, with a sample mean of 74.15 beats per minute and a median of 76 beats per minute. The first quartile is 68 and the third quartile is 80, so the middle 50% of female resting heart rates are between 68 and 80 beats per minute. The sample standard deviation is 8.11, which indicates more variability than was observed for males.

Max :  89
Min :  57
Mean :  74.15385
Standard Deviation : 8.105227
Median : 76
Quartiles : 57 68 76 80 89

Female Heart Rate Histogram

The histogram shows that the observations are generally concentrated around the 70s, but there is more spread compared with the male distribution.

Female Heart Rate Normal Probability Plot

The normal probability plot follows the reference line reasonably well overall, although there are some deviations from the line, particularly toward the ends. Therefore, the female resting heart rate distribution appears to be approximately normal, with some possible departures from normality.

Side by Side

The side-by-side box plots show that the resting heart rates for males and females are relatively similar in their centers. The male median is 73 beats per minute, while the female median is 76 beats per minute, so females have a slightly higher median resting heart rate.

The female box plot is wider than the male box plot, indicating that females have greater variability in resting heart rate. This is also consistent with the standard deviations: 5.88 for males compared with 8.11 for females. The overall range is also slightly larger for females, from 57 to 89, compared with 58 to 86 for males.

Overall, the box plots suggest that the two groups have similar typical resting heart rates, but the female resting heart rates have more variation than the male resting heart rates.

dat<-as.data.frame(read.csv('https://raw.githubusercontent.com/tmatis12/datafiles/main/normtemp.csv'))

library(dplyr)
library(ggplot2)

male=dat%>%filter(Sex==1)
malebeats=as.data.frame(male[,3])

Mmax<-max(malebeats)
Mmin<-min(malebeats)
Mmean<-mean(c(malebeats[,1]))
Mstd<-sd(c(malebeats[,1]))
Mmed<-median(c(malebeats[,1]))
Mqua<-quantile(c(malebeats[,1]))

cat("Max : ", Mmax)
cat("Min : ", Mmin)
cat("Mean : ",Mmean)
cat("Standard Deviation :", Mstd)
cat("Median :", Mmed)
cat("Quartiles :", Mqua)

ggplot(data.frame(x=malebeats[,1]), aes(x = x)) +
  geom_histogram(col='blue',fill = 'blue') +
  labs(x = "Male", y = "Frequancy", title = "Male Heart Rate Histogram")



ggplot(malebeats, aes(sample = malebeats[,1])) + 
  stat_qq(color = "blue") +                              
  stat_qq_line()+
  labs(x = "Actual Data", y = "Expected", title = "Male Heart Rate Normal Probability Plot")

female=dat%>%filter(Sex==2)
femalebeats=as.data.frame(female[,3])

Fmax<-max(femalebeats)
Fmin<-min(femalebeats)
Fmean<-mean(c(femalebeats[,1]))
Fstd<-sd(c(femalebeats[,1]))
Fmed<-median(c(femalebeats[,1]))
Fqua<-quantile(c(femalebeats[,1]))

cat("Max : ", Fmax)
cat("Min : ", Fmin)
cat("Mean : ",Fmean)
cat("Standard Deviation :", Fstd)
cat("Median :", Fmed)
cat("Quartiles :", Fqua)

ggplot(data.frame(x=femalebeats[,1]), aes(x = x)) +
  geom_histogram(col='pink',fill = 'pink') +
  labs(x = "Female", y = "Frequancy", title = "Female Heart Rate Histogram")

ggplot(femalebeats, aes(sample = femalebeats[,1])) +   
  stat_qq(color = "pink") +                              
  stat_qq_line()+
  labs(x = "Actual Data", y = "Expected", title = "Female Heart Rate Normal Probability Plot")

ggplot(dat, aes(x = factor(Sex), y = Beats, fill = factor(Sex))) +
  geom_boxplot() +
  scale_fill_manual(values = c("1" = "blue", "2" = "pink")) +
  labs(x = "1: Male, 2: Female", 
       y = "Beats", 
       title = "Side by Side Boxplot")