num.to.cat {eatTools}R Documentation

Transform continuous variables into ordered factors

Description

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

Usage

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

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))

[Package eatTools version 0.6.0 Index]