Descriptive statistics and R

Descriptive statistics summarize various parameters of a dataset. They can be measures of central tendency (e.g., mean, mode, median) or measures of variability (e.g., standard deviation, variance). Here is an R function that describes many of them in one command.

We will use ‘iris’ dataset to illustrate.

dat <- iris
library(pastecs)
stat.desc(dat[1:4], norm = TRUE))

Note that we have rounded off the output to include two digits after the decimal point.

round(stat.desc(dat[1:4], norm = TRUE), 2)