Univariate Statistics

Basic description

An ordinary five-point summary plus the mean can be obtained via

summary(mydata$income)

Tukey has a special definition of the "hinges" in his five-point summary, which may be requested via

fivenum(mydata$income)

Mean, variance, standard deviation

These statistics are implemented in the "core" or R. For other statistics, special packages have to be installed.

What's special about procedure "mean" is that you may obtain trimmed means, as in

mean(mydata$income, trim=.05)

Here, the top and bottom five per cent of income will be ignored in computation of the mean.

However, trimming is not available for the variance and the standard deviation:

var(mydata$income)

sd(mydata$income)

Note that variance and S.D. will be computed as estimates for a population.

© W. Ludwig-Mayerhofer, R Guide | Last update: 23 Sep 2016