cowboy_cut: Cut ordinal variables

View source: R/functions_tools.r

cowboy_cutR Documentation

Cut ordinal variables

Description

If we are in a hurry and need to cut a lot of likert-scale or similar type of variables into MCA-friendly ordered factors this function comes in handy. cowboy_cut will try its best to create approx 3-5 categories, where the top and the bottom are smaller than the middle. Missing or other unwanted categories are recoded but still influence the categorization. So that when cowboy_cut tries to part the top of a variable with a threshold around 10 Make sure that levels are in the right order before cutting.

Usage

cowboy_cut(x, top.share = 0.1, bottom.share = 0.1, missing = "Missing")

Arguments

x

a factor

top.share

approximate share in top category

bottom.share

approximate share in bottom category

missing

a character vector with all the missing or unwanted categories.

Value

a recoded factor


Rsoc/soc.ca documentation built on Oct. 13, 2023, 7:35 p.m.