toLik {multiUS} | R Documentation |
The function transforms a continous variable to a k-point Likert-type variable. Different styles of answering to a survey are possible.
toLik(x, type = "eq", q = 1.5, k = 5, r = range(x), num = TRUE)
x |
Vector with values to be transformed. |
type |
Type of transformation. Possible values are: |
q |
Extension factor. Tells how much is each next interval wider then the previous one. Not used when |
k |
Number of classes. |
r |
Minimum and maximum values to define intervals of |
num |
If |
Transformed values are organized into a vector.
Aleš Žiberna
x <- rnorm(1000) hist(x = toLik(x, type = "eq"), breaks = 0:5+0.5, xlab = "answer", main = "type = 'eq'") hist(x = toLik(x, type = "yes"), breaks = 0:5+0.5, xlab = "answer", main = "type = 'yes'") hist(x = toLik(x, type = "no"), breaks = 0:5+0.5, xlab = "answer", main = "type = 'no'") hist(x = toLik(x, type = "avg"), breaks = 0:5+0.5, xlab = "answer", main = "type = 'avg'")