Flip Assigment Description

For this Flip Assigment, we need to download the .csv file into a variable and separate the data in terms of sex

The code below shows how to do it:

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

dat_male <- dat[1:65,]
dat_fem <- dat[66:130,]

Printing Descriptive Statitics

The code below prints the descriptive statistics:

Males Descriptive Statistics

print(min(dat_male$Beats))
## [1] 58
print(max(dat_male$Beats))
## [1] 86
print(mean(dat_male$Beats))
## [1] 73.36923
print(sd(dat_male$Beats))
## [1] 5.875184
print(median(dat_male$Beats))
## [1] 73
print(quantile(dat_male$Beats))
##   0%  25%  50%  75% 100% 
##   58   70   73   78   86
hist(dat_male$Beats
     ,main="Male Resting Beats"
     ,col="green"
     ,xlab="Resting Beats")

qqnorm(dat_male$Beats,
       main="Male Beats Normal Distribution",
       xlab="Normal Quantities",
       ylab="Heart Beats")

Females Descriptive Statistics

print(min(dat_fem$Beats))
## [1] 57
print(max(dat_fem$Beats))
## [1] 89
print(mean(dat_fem$Beats))
## [1] 74.15385
print(sd(dat_fem$Beats))
## [1] 8.105227
print(median(dat_fem$Beats))
## [1] 76
print(quantile(dat_fem$Beats))
##   0%  25%  50%  75% 100% 
##   57   68   76   80   89
hist(dat_fem$Beats
     ,main="Female Resting Beats"
     ,col="pink"
     ,xlab="Resting Beats")

qqnorm(dat_fem$Beats,
       main="Female Beats Normal Distribution",
       xlab="Normal Quantities",
       ylab="Heart Beats")

Comparision between boxplots

boxplot(dat_male$Beats, dat_fem$Beats,
        names=c("Male","Female"),
        main="Side-by-side boxplots")

Conclusions and Comparisions

When comparing the descriptive statistics, Females present higher maximum values and lower minimum values, besides a higher median.

Considering the mean and std values, it is not possible see a huge difference between means, but females present higher STD values.

All these informations are well summarized in the boxplot. Besides that, we have pretty much similar minimum values (difference of 1 beat per minute).

Complete Code

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

dat_male <- dat[1:65,]
dat_fem <- dat[66:130,]


#-------------- Male Data 


print(min(dat_male$Beats))
print(max(dat_male$Beats))
print(mean(dat_male$Beats))
print(sd(dat_male$Beats))
print(median(dat_male$Beats))
print(quantile(dat_male$Beats))

hist(dat_male$Beats
     ,main="Male Resting Beats"
     ,col="green"
     ,xlab="Resting Beats")

qqnorm(dat_male$Beats,
       main="Male Beats Normal Distribution",
       xlab="Normal Quantities",
       ylab="Heart Beats")

#-------------- Female Data 

print(min(dat_fem$Beats))
print(max(dat_fem$Beats))
print(mean(dat_fem$Beats))
print(sd(dat_fem$Beats))
print(median(dat_fem$Beats))
print(quantile(dat_fem$Beats))

hist(dat_fem$Beats
     ,main="Female Resting Beats"
     ,col="pink"
     ,xlab="Resting Beats")

qqnorm(dat_fem$Beats,
       main="Female Beats Normal Distribution",
       xlab="Normal Quantities",
       ylab="Heart Beats")

#-------------- Box Plots

boxplot(dat_male$Beats, dat_fem$Beats,
        names=c("Male","Female"),
        main="Side-by-side boxplots")