num.to.cat: Transform continuous variables into ordered factors

Description Usage Arguments Value Author(s) Examples

View source: R/num.to.cat.r

Description

Function is useful if parameters on the ‘PISA’ metric should be transformed into competence levels.

Usage

1
num.to.cat(x, cut.points, cat.values = NULL)

Arguments

x

Numeric vector.

cut.points

Numeric vector with cut scores.

cat.values

Optional: vector with labels for the cut scores. Note: if specified, length of cat.values should be length(cut.points)+1.

Value

Vector with factor values.

Author(s)

Sebastian Weirich

Examples

1
2
3
values <- rnorm(10,0,1.5) * 100 + 500
num.to.cat(x = values, cut.points = 390+0:3*75)
num.to.cat(x = values, cut.points = 390+0:3*75, cat.values = c("1a", "1b", 2:4))

eatTools documentation built on Nov. 10, 2021, 5:07 p.m.