Question a

mydata <- read.table("Marathon.csv", header = TRUE, sep = ";", dec = ",")

head(mydata)
##   ID Weight Height Pressure Beat Hemoglobin Hematocrit Cholesterol Glucose
## 1  1     72  179.0      105   64        160         50         4.9     4.7
## 2  2     68  178.0      105   60        158         51         4.8     4.9
## 3  3     64  174.0      109   54        155         51         4.5     7.0
## 4  4     63  174.0      112   54        153         58         8.0     7.2
## 5  5     61  173.5      100   53        152         59         4.6     6.7
## 6  6     60  173.0       99   53        158         49         3.9     6.0
##   Gender
## 1      1
## 2      0
## 3      0
## 4      0
## 5      0
## 6      0

Question b

Question c

mean(mydata$Height)
## [1] 176.9571

Average height for people, included in the sample, is 176.96 cm.

sd(mydata$Height)
## [1] 5.85156

Standard deviation, which is meausre of variability, equals 5.85 cm.

If assuming that height is distributed normally in people, then within 176.96 cm +- 5.85 cm 68.3 % of people are expected to be.

Question d

mydata$Gender <- factor(mydata$Gender,
                        levels = c(0, 1),
                        labels = c("F", "M"))

Question e

library(psych)
describeBy(mydata$Glucose, group = mydata$Gender)
## 
##  Descriptive statistics by group 
## group: F
##    vars  n mean   sd median trimmed  mad min max range skew kurtosis   se
## X1    1 14 5.96 0.93    5.8    5.97 1.33 4.6 7.2   2.6 0.12    -1.62 0.25
## ------------------------------------------------------------ 
## group: M
##    vars  n mean  sd median trimmed  mad min max range skew kurtosis   se
## X1    1 21 4.54 0.7    4.6    4.45 0.74 3.8   6   2.2 0.97    -0.13 0.15