Learn R Programming

MSMU (version 0.1.2)

center_stats: Summary of Central Tendency

Description

Computes a variety of center statistics for a numeric vector, including: mean, median, trimmed means (10% and 25%), and estimated mode (via probability density function using estimate_mode()).

Usage

center_stats(x)

Value

A named numeric vector with values for:

mean

Arithmetic mean

median

Median

trim25

25% trimmed mean

trim10

10% trimmed mean

est_mode

Estimated mode from estimate_mode()

Arguments

x

A numeric vector.

See Also

estimate_mode

Examples

Run this code
# Center Stats of continuous random data
set.seed(123)
x <- rnorm(1000, mean=50, sd=10)
center_stats(x)

# Center Stats of Sepal Length in iris data set
data("iris")
center_stats(iris$Sepal.Length)

Run the code above in your browser using DataLab