Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: stats
See also: median grbox quantile summarize

Quantlet: fivenum
Description: computes the five number summary consisting of the minimum and maximum, the quartiles and the median.

Usage: five = fivenum (x, {, xvars})
Input:
x n x p matrix, variables
xvars p x 1 string vector (optional) with variable names
Output:
five string output, containing p five number summaries.

Note:

Example:
library("stats")
setenv("outputstringformat", "%s")
x = read("popul")[,1]
fivenum(x)

Result:
Contents of five
[ 1,]
[ 2,] ==================================================
[ 3,]  Five number summary
[ 4,] --------------------------------------------------
[ 5,]    Minimum                    63
[ 6,]    25% Quartile               74
[ 7,]    Median                     88
[ 8,]    75% Quartile            183.5
[ 9,]    Maximum                   778
[10,] ==================================================
[11,]
Example:
library("stats")
setenv("outputstringformat", "%s")
x = read("pullover")[,1:2]
fivenum(x, "Sales"|"price")

Result:
Two five number summaries with variable names

Contents of five

[ 1,]
[ 2,] ==================================================
[ 3,]  Five number summary: Sales
[ 4,] --------------------------------------------------
[ 5,]    Minimum                    97
[ 6,]    25% Quartile              165
[ 7,]    Median                  176.5
[ 8,]    75% Quartile              189
[ 9,]    Maximum                   230
[10,] ==================================================
[11,]
[12,] ==================================================
[13,]  Five number summary: price
[14,] --------------------------------------------------
[15,]    Minimum                    80
[16,]    25% Quartile               95
[17,]    Median                   99.5
[18,]    75% Quartile              120
[19,]    Maximum                   125
[20,] ==================================================
[21,]



Author: W. Haerdle, T. Koetter, Marlene Mueller, 20021106 license MD*Tech
(C) MD*TECH Method and Data Technologies, 05.02.2006