BinQuant: Recode a quantitative variable as a binned factor.

View source: R/goodies4MCA.R

BinQuantR Documentation

Recode a quantitative variable as a binned factor.

Description

BinQuant: a function to recode a quantitative variable as a binned factor with (roughly) the same number of observations per bin.

Usage

BinQuant(x, nClass = 4, stem = "", levelNames = NULL)

Arguments

x

A vector (of numbers)

nClass

= 4 number of bins for the recoded factor

stem

= ” Stem for the levels of the recoded factor

levelNames

(default = NULL) the name of the levels of the factor. If NULL use the values 1 to nClass.

Details

Use to create roughly) balanced factors from quantitative variables in MCA.

Value

a vector factor with bin values.

Author(s)

Hervé Abdi

Examples

aFactor <-  BinQuant(1:15)

HerveAbdi/data4PCCAR documentation built on Sept. 11, 2022, 4:19 p.m.