library(modeest) # Berechnung des Modus
# Datensatz einlesen
data <- read.table("https://mmi.psycho.unibas.ch/r-toolbox/data/Eingangsfragebogen11.txt", header=TRUE)
# Variable spezifizieren
Variable <- "Alter"
mean(data[,Variable], na.rm=T)
## [1] 23.80952
median(data[,Variable], na.rm=T)
## [1] 21
mlv(data[,Variable], method="naive", na.rm=T)
## [1] 20
sd(data[,Variable], na.rm=T)
## [1] 7.235824
var(data[,Variable], na.rm=T)
## [1] 52.35714
range(data[,Variable], na.rm=T)
## [1] 16 52
median(abs(data[,Variable]-median(data[,Variable], na.rm=T)), na.rm=T)
## [1] 2