Introduction

The file normtemp.csv contains the resting body temperature and the resting heart rate of 130 randomly sampled subjects, 65 males (coded as 1) and 65 females (coded as 2). This report analyzes only the resting heart rate, measured in beats per minute.

Data

The data is read directly from the online file and the heart rate column is split into the two groups.

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

male <- dat$Beats[dat$Sex == 1]
female <- dat$Beats[dat$Sex == 2]

length(male)
## [1] 65
length(female)
## [1] 65

Both groups have 65 observations, as expected.

Males

Descriptive statistics

summary(male)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   58.00   70.00   73.00   73.37   78.00   86.00
sd(male)
## [1] 5.875184
IQR(male)
## [1] 8

Histogram

hist(male,
     col = "blue",
     main = "Resting Heart Rate of Males",
     xlab = "Male Resting Heart Rate (beats per minute)")

Normal probability plot

qqnorm(male, main = "Normal Q-Q Plot: Male Resting Heart Rate")
qqline(male)

Comments

The resting heart rate of the 65 males goes from a minimum of 58 to a maximum of 86 beats per minute. The sample mean is 73.37 and the sample median is 73, so the two measures of center are less than half a beat apart. That is a first sign that the distribution is close to symmetric, because a long tail on one side would pull the mean away from the median.

The spread is moderate. The sample standard deviation is 5.88 beats per minute and the interquartile range is 8, with the first quartile at 70 and the third quartile at 78. The middle half of the males falls inside an eight beat window, which is a fairly tight cluster around the center.

The histogram agrees with the summary statistics. It has a single peak in the low 70s, the bars fall off at a similar rate on both sides, and no bar is isolated from the rest of the data, so there is no sign of an outlier or of a second group hiding in the sample.

The normal probability plot is close to a straight line. The points follow the reference line through the middle of the distribution and bend only slightly at the two ends, which is common in a sample of this size. The statistics and both plots are consistent with male resting heart rate being approximately normally distributed.

Females

Descriptive statistics

summary(female)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   57.00   68.00   76.00   74.15   80.00   89.00
sd(female)
## [1] 8.105227
IQR(female)
## [1] 12

Histogram

hist(female,
     col = "pink",
     main = "Resting Heart Rate of Females",
     xlab = "Female Resting Heart Rate (beats per minute)")

Normal probability plot

qqnorm(female, main = "Normal Q-Q Plot: Female Resting Heart Rate")
qqline(female)

Comments

The resting heart rate of the 65 females goes from 57 to 89 beats per minute, which is a slightly wider range than the males. The sample mean is 74.15 and the sample median is 76, so here the mean sits almost two beats below the median. That gap points to a mild left skew, meaning a few low values are pulling the average down while most observations sit higher.

The spread is clearly larger than for the males. The sample standard deviation is 8.11 compared to 5.88, and the interquartile range is 12 compared to 8, with quartiles at 68 and 80. The middle half of the females covers a window half again as wide as the male one, so the female heart rates are less consistent from person to person.

The histogram is flatter and wider than the male one and its left tail is longer, which is the visual version of the mean sitting below the median. Most of the observations are in the middle 70s and again no bar is separated from the rest.

The normal probability plot is roughly linear through the center, but the lowest observations fall below the reference line, which is what a left tail looks like on this type of plot. Normality is still a reasonable assumption for the females, but the fit is not as clean as it is for the males.

Comparison

boxplot(Beats ~ Sex, data = dat,
        names = c("Male", "Female"),
        col = c("blue", "pink"),
        main = "Resting Heart Rate by Sex",
        xlab = "Sex",
        ylab = "Resting Heart Rate (beats per minute)")

Comments

Similarities. The two groups overlap almost completely. The male values go from 58 to 86 and the female values from 57 to 89, so the whiskers cover essentially the same territory and neither group sits clearly above the other. The boxes also overlap over most of their height, which means many males and females share the same resting heart rates. Neither boxplot marks any point as an outlier, so no single observation is driving either summary.

Differences. The differences are in the center and in the spread. The female median is 76 and the male median is 73, so the typical female in this sample has a resting heart rate about three beats per minute higher. That difference is small compared to how much the values vary inside each group, so it is a shift and not a separation.

The female box is also taller. Its interquartile range is 12 beats against 8 for the males, and the female lower whisker reaches further down. The male distribution is more tightly packed around its center while the female distribution is more variable in both directions. This matches the standard deviations, 8.11 for females against 5.88 for males, and it matches the shapes of the two histograms.

Overall. Resting heart rate looks similar for males and females in this sample. Females are centered slightly higher and are more variable, but the overlap is large enough that sex alone would be a poor predictor of an individual’s resting heart rate.

Complete code

knitr::opts_chunk$set(echo = TRUE, fig.align = "center")
dat <- read.csv("https://raw.githubusercontent.com/tmatis12/datafiles/main/normtemp.csv")

male <- dat$Beats[dat$Sex == 1]
female <- dat$Beats[dat$Sex == 2]

length(male)
length(female)
summary(male)
sd(male)
IQR(male)
hist(male,
     col = "blue",
     main = "Resting Heart Rate of Males",
     xlab = "Male Resting Heart Rate (beats per minute)")
qqnorm(male, main = "Normal Q-Q Plot: Male Resting Heart Rate")
qqline(male)
summary(female)
sd(female)
IQR(female)
hist(female,
     col = "pink",
     main = "Resting Heart Rate of Females",
     xlab = "Female Resting Heart Rate (beats per minute)")
qqnorm(female, main = "Normal Q-Q Plot: Female Resting Heart Rate")
qqline(female)
boxplot(Beats ~ Sex, data = dat,
        names = c("Male", "Female"),
        col = c("blue", "pink"),
        main = "Resting Heart Rate by Sex",
        xlab = "Sex",
        ylab = "Resting Heart Rate (beats per minute)")