1 Resting Beat Data Set

1.1 Statistical Analysis of Data for Male Resting Heart Rate

  • Male Resting Heart Rate Min
## [1] 58
  • Male Testing Heart Rate Max
## [1] 86
  • Male Sample Mean of Resting Heart Rate
## [1] 73.36923
  • Male Standard Deviation of Heart Rate
## [1] 5.875184
  • Male Median of Heat Rate
## [1] 73
  • Male Quartiles of Heart Rate
##   0%  25%  50%  75% 100% 
##   58   70   73   78   86
  • Histogram of Male Heart Rate

  • Normal Probablity Plot of Male Heart Rate

  • Comments on Male Data

It’s interesting to see that the min and max resting heart rates for males is 58 and 86 respectfully with a difference of 18 beats between the two values. Out of the 65 points of data we see that we get a mean value of 73.36 which in turn is in the average range for a male. We also get of a median of 73 beats for males. Our standard deviation is 5.8 which means we see how far out our data spreads from the mean/median value. From the quartiles we can see that since our median value of 73 sits between Quartile 1 and Quartile 3 we can assume that our data is not heavily skewed. From looking at the histogram we can see that where the median and the mean lie we get our highest level of occurances, which makes sense casue and average heart rate for a man is between 60 and 100. Looking at the normal probablility plot we can see that the data is pretty liner cause of how close it is to the red reference line. You can also assume that the data is not skewed heavily to one side or the other of the reference line.

1.2 Statistical Analysis of Data for Female Resting Heart Rate

  • Female Resting Heart Rate Min
## [1] 57
  • Female Testing Heart Rate Max
## [1] 89
  • Female Sample Mean of Resting Heart Rate
## [1] 74.15385
  • Female Standard Deviation of Heart Rate
## [1] 8.105227
  • Female Median of Heat Rate
## [1] 76
  • Female Quartiles of Heart Rate
##   0%  25%  50%  75% 100% 
##   57   68   76   80   89
  • Histogram of Female Heart Rate

  • Normal Probablity Plot of Female Heart Rate

-Comments on Female Data

Looking at the data for females we can see that across the board for all the values that we find they are sit slightly higher than they do for males. This makes sense since females do have a higher resting average heart rate when compared to males.It is intresting to note that the standard deviation is 8.10 while the males standard deviation is 5.87 which shows that males rest more towards the mean value while women sit on the higher side of the mean when compared to males. Looking at the normal probability plot it looks to be relatively normal but it does show that it is skewed to the low and high side of the reference line. The thing that I notice is that for the histogram you can see where the largest amount of frequencies lies above the meadian rather than right in the middle. Looking at the quartiles you can see that our median is our Quartile 2 value which would indicate that the data set is not heavily skewed in on direction or the other.

-Side by Side Box Plots

  • Comments on Box Plots

Looking at the a side by side comparison of the box plots you would notice that the females box plot is larger than the males box plot. It lookes to me that the females cover a larger area when looking at heart beats. You can also see that the median of the females box plot higher than the males box plot. It looks to be also that the males box plot is smaller than the females box plot. The box plots are similar in regards to where they are located along the y-axis, to where one is not far above or below the other.

–Complete Code

raw_url <-"https://raw.githubusercontent.com/tmatis12/datafiles/main/normtemp.csv"

temp.data <- read.csv(raw_url)

temp.data$Sex <- as.character(temp.data$Sex)

temp.data$Sex[temp.data$Sex == "1"] <- "Male"

temp.data$Sex[temp.data$Sex == "2"] <- "Female"

temp.data$Sex <- as.factor(temp.data$Sex)

rmarkdown::paged_table(temp.data)

Mbeats_min <-min(temp.data$Beats[temp.data$Sex == "Male"])

Mbeats_min

Mbeats_max <-max(temp.data$Beats[temp.data$Sex == "Male"])

Mbeats_max

Mbeats_mean <- mean(temp.data$Beats[temp.data$Sex == "Male"])

Mbeats_mean

Mbeats_sd <- sd(temp.data$Beats[temp.data$Sex == "Male"])

Mbeats_sd

Mbeats_med <- median.default(temp.data$Beats[temp.data$Sex == "Male"])

Mbeats_med

Mbeats_Quat <- quantile(temp.data$Beats[temp.data$Sex == "Male"])

Mbeats_Quat

Mbeats_hist <- hist(temp.data$Beats[temp.data$Sex == "Male"],
                    main = "Male Heart Beats", #Title of Histogram
                    xlab = "Heart Beat", # X-Axsis Title
                    ylab = "Frequency", #Y-Axsis Title
                    col = "Blue", #Color of Graph
                    border= "Black", # Color of the Border
                    breaks = 7)

Male_Data <- subset(temp.data, Sex == "Male")

Mbeats_NP <- qqnorm(Male_Data$Beats, main = "Normal Q-Q Plot ( Sex = Male)", xlab = "Theoretical Quantiles", ylab = "Sample Quantiles (Beats)", col = "blue", pch= 16)

qqline(Male_Data$Beats, col = "red", lwd = 2)

Fbeats_min <-min(temp.data$Beats[temp.data$Sex == "Female"])

Fbeats_min

Fbeats_max <-max(temp.data$Beats[temp.data$Sex == "Female"])

Fbeats_max

Fbeats_mean <- mean(temp.data$Beats[temp.data$Sex == "Female"])

Fbeats_mean

Fbeats_sd <- sd(temp.data$Beats[temp.data$Sex == "Female"])

Fbeats_sd

Fbeats_med <- median.default(temp.data$Beats[temp.data$Sex == "Female"])

Fbeats_med

Fbeats_Quat <- quantile(temp.data$Beats[temp.data$Sex == "Female"])

Fbeats_Quat

Fbeats_hist <- hist(temp.data$Beats[temp.data$Sex == "Female"],
                    main = "Female Heart Beats", #Title of Histogram
                    xlab = "Heart Beat", # X-Axsis Title
                    ylab = "Frequency", #Y-Axsis Title
                    col = "pink", #Color of Graph
                    border= "Black", # Color of the Border
                    breaks = 7)

Female_Data <- subset(temp.data, Sex == "Female")

Fbeats_NP <- qqnorm(Female_Data$Beats, main = "Normal Q-Q Plot ( Sex = Female)", xlab = "Theoretical Quantiles", ylab = "Sample Quantiles (Beats)", col = "pink", pch= 20)

qqline(Male_Data$Beats, col = "black", lwd = 2)


boxplot(Beats ~ factor(Sex), data = temp.data,
        names = c("Female","Male"),
        col = c("Pink","Blue"),
        main = "Resting Heart Rate (Beats) Comparison by Sex",
        xlab = "Gender Grouping",
        ylab = "Hear Rate")