Description Usage Arguments Details Value See Also Examples
View source: R/descriptive_statistics.R
Calculates the five number summary of a vector of data or of each column of a matrix of data, using the estimators of the lower quartile, median and upper quartile in the STAT002 notes.
1 | five_number(x, type = 6, na.rm = FALSE)
|
x |
A numeric vector or matrix. |
type |
Argument |
na.rm |
A logical scalar. If true, any |
The five number summary contains the sample minimum and maximum and
estimates of the lower quartile, median and upper quartile, i.e. the
25%, 50% and 75% quantiles. These quantiles are estimated using the
quantile
function. By default, type = 6
is
used in the call to quantile
in order to use the estimator defined
in the STAT002 notes.
A numeric vector (if the input was a vector) or matrix (if the input was a matrix).
quantile
for calculating sample quantiles.
1 2 3 4 5 6 | birth_times <- ox_births[, "time"]
five_number(birth_times)
# Note: summary() uses type = 7 in the call to quantile()
five_number(birth_times, type = 7)
summary(birth_times)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.