1. Data

ecotrack <- c(22, 25, 19, 30, 24, 21, 45, 23, 20, 26, 24, 22, 18, 27, 23)

2. Soal 1 (Mean, Median, Modus)

mean(ecotrack)
## [1] 24.6
median(ecotrack)
## [1] 23
# Fungsi Modus
get_mode <- function(x) {
  u <- unique(x)
  tab <- tabulate(match(x, u))
  u[tab == max(tab)]
}
get_mode(ecotrack)
## [1] 22 24 23

3. Soal 2 (Q1, Q3, IQR)

quantile(ecotrack, probs = 0.25, type = 6)
## 25% 
##  21
quantile(ecotrack, probs = 0.75, type = 6)
## 75% 
##  26
IQR(ecotrack, type = 6)
## [1] 5

4. Soal 3 (Varians & SD)

var(ecotrack)
## [1] 41.54286
sd(ecotrack)
## [1] 6.445375

5. Soal 4 (Skewness)

library(moments)
skewness(ecotrack)
## [1] 2.212573