metric_mode: Metric for determining the most popular value

Description Usage Arguments Details Value Recovery Use Examples

View source: R/metrics.R

Description

Computes the mode given a vector of data.

Usage

1
metric_mode(x, na.rm = FALSE)

Arguments

x

A vector of data.

na.rm

A logical indicating if missing values (including NaN) should be removed. Default: FALSE

Details

Be forewarned that this method of obtaining the mode does not take into consideration ties. That is, only the first group with the maximum value is returned. If a second group also has a similar count, this group will not be returned.

Value

A single numeric or integer value.

Recovery Use

The mode should be used when computing latent class recovery among subjects.

Examples

1
2
3
# Sample class-data
x = c(0, 0, 0, 1, 1, 2)
metric_mode(x)

tmsalab/edmcore documentation built on Sept. 4, 2021, 2:46 a.m.