# How do you calculate mean, median, MAD and SD in R

Let’s take a normal distribution.

> dist = rnorm(1000,mean=100,sd=10) > plot(density(dist))

Mean

> mean(dist) [1] 100.0442

Median

> median(dist) [1] 100.0193

Mean Average Deviation

> mad(dist) [1] 9.395154

Standard Deviation

> sd(dist) [1] 9.87821