normtemp <- read.csv("https://raw.githubusercontent.com/tmatis12/datafiles/main/normtemp.csv")
normtemp$heart_rate <- as.numeric(normtemp[, 3])
normtemp$gender <- as.numeric(normtemp[, 2])
This report analyses the file normtemp.csv regarding the measurements on the resting body temperature and resting heart rate from n=65 randomly sampled males, identified as 1, and n=65 randomly sampled females, as 2. This analysis focuses only on the resting heart rate.
The following information shows data, histogram, and Normal Q-Q Plot regarding the male sample (n=65).
males <- normtemp[normtemp$gender == 1, ]
hr_males <- males$heart_rate
summary(hr_males)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 58.00 70.00 73.00 73.37 78.00 86.00
sd(hr_males)
## [1] 5.875184
hist(hr_males, col = "blue",
main = "Histogram of Male Resting Heart Rate",
xlab = "Heart Rate (bpm)")
qqnorm(hr_males, main = "Normal Q-Q Plot - Males")
qqline(hr_males, col = "red")
The data of male resting heart rate exhibits a minimum of 58 bpm (beats per minute) and a maximum of 86 bpm. The statistics show a mean of 73.37 bpm and a median of 73 bpm, with a standard deviation of 5.88 bpm.
The histogram presents a symmetric shape more distributed around 70 and 75 bpm with more than 20 men falling into this range.
Normal Q-Q Plot for males indicates the data points near the red reference line, which indicates an approximately normal distribution for resting heart rate.
The following information shows data, histogram, and Normal Q-Q Plot regarding the female sample (n=65).
females <- normtemp[normtemp$gender == 2, ]
hr_females <- females$heart_rate
summary(hr_females)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 57.00 68.00 76.00 74.15 80.00 89.00
sd(hr_females)
## [1] 8.105227
hist(hr_females, col = "pink",
main = "Histogram of Female Resting Heart Rate",
xlab = "Heart Rate (bpm)")
qqnorm(hr_females, main = "Normal Q-Q Plot - Females")
qqline(hr_females, col = "red")
For the female sample the data of resting heart rate shows a minimum of 57 bpm (beats per minute) and a maximum of 89 bpm. The statistics reveal a mean of 74.15 bpm and a median of 76 bpm, with a standard deviation of 8.105 bpm.
The histogram indicates that the values are concentrated around 75 and 80 bpm with more than 15 women falling into this range.
Furthermore, the Normal Q-Q Plot for females demonstrates the data points closely the red reference line, supporting a normal distribution for resting heart rate.
The following box plots show data between the male and the female sample.
boxplot(hr_males, hr_females,
names = c("Male", "Female"),
col = c("lightblue", "lightpink"),
main = "Comparison of Resting Heart Rate by Gender",
ylab = "Heart Rate (bpm)")
The box plots compare the resting heart rates of males and females side by side. This comparison reveals greater variability in resting heart rate among females compared to males. Specifically, the interquartile range for females spans from 68 to 80 bpm, whereas the range for males is narrower, spanning from 70 to 78 bpm.
This higher variability for females is also supported by the standard deviation, which is greater for females (8.11) than for males (5.88), confirming a wider dispersion for women.
Additionally, the median values are relatively close to each other, 73 bpm for males and 76 bpm for females.
Furthermore, the minimum values of resting heart rate for males and females are similar, with 57 bpm for females and 58 bpm for males. However, the maximum value for females is higher in comparison to males, reaching 89 bpm for women and 86 bpm for men. Consequently, this represents a total range of 32 for women and only 28 for men.
In summary, the analysis of the normtemp.csv data indicates that both male and female resting heart rates conform well to a normal distribution, as supported by the histogram and QQ-Plots.
Means and medians are relatively close. However, the female sample reveals a greater variability. This is confirmed by the higher standard deviation and the interquartile range for women in compared to the male group.
normtemp <- read.csv("https://raw.githubusercontent.com/tmatis12/datafiles/main/normtemp.csv")
normtemp$heart_rate <- as.numeric(normtemp[, 3])
normtemp$gender <- as.numeric(normtemp[, 2])
# Males Analysis
males <- normtemp[normtemp$gender == 1, ]
hr_males <- males$heart_rate
summary(hr_males)
sd(hr_males)
hist(hr_males, col = "blue", main = "Histogram of Male Resting Heart Rate", xlab = "Heart Rate (bpm)")
qqnorm(hr_males, main = "Normal Q-Q Plot - Males")
qqline(hr_males, col = "red")
# Females Analysis
females <- normtemp[normtemp$gender == 2, ]
hr_females <- females$heart_rate
summary(hr_females)
sd(hr_females)
hist(hr_females, col = "pink", main = "Histogram of Female Resting Heart Rate", xlab = "Heart Rate (bpm)")
qqnorm(hr_females, main = "Normal Q-Q Plot - Females")
qqline(hr_females, col = "red")
# Comparison Boxplot
boxplot(hr_males, hr_females,
names = c("Male", "Female"),
col = c("lightblue", "lightpink"),
main = "Comparison of Resting Heart Rate by Gender",
ylab = "Heart Rate (bpm)")