min_cut: Cut a continuous variable into categories with a specified...

Description Usage Arguments Value Examples

View source: R/functions_tools.r

Description

Many continuous variables are very unequally distributed, often with many individuals in the lower categories and fewer in the top. As a result it is often difficult to create groups of equal size, with unique cut-points. By defining the wanted minimum of individuals in each category, but still allowing this minimum to be surpassed, it is easy to create ordinal variables from continuous variables. The last category will not neccessarily have the minimum number of individuals.

Usage

1
min_cut(x, min.size = length(x)/10)

Arguments

x

is a continuous numerical variable

min.size

is the minimum number of individuals in each category

Value

a numerical vector with the number of each category

Examples

1
2
3
4
a <- 1:1000
table(min_cut(a))
b <- c(rep(0, 50), 1:500)
table(min_cut(b, min.size = 20))

soc.ca documentation built on Sept. 5, 2021, 5:21 p.m.

Related to min_cut in soc.ca...