Convert normal to likert

norm2likert(x, prob, mu = mean(x), sd = stats::sd(x))

Arguments

x

the normally distributed vector

prob

a vector of probabilities

mu

the mean of x (calculated from x if not given)

sd

the SD of x (calculated from x if not given)

Value

a vector with a specified distribution

Examples

x <- rnorm(10000) y <- norm2likert(x, c(.1, .2, .35, .2, .1, .05)) g <- ggplot2::ggplot() + ggplot2::geom_point(ggplot2::aes(x, y)) ggExtra::ggMarginal(g, type = "histogram")
y <- norm2likert(x, c(.4, .3, .2, .1)) g <- ggplot2::ggplot() + ggplot2::geom_point(ggplot2::aes(x, y)) ggExtra::ggMarginal(g, type = "histogram")