powered by
This functions creates an ordinalized form of a continuous variable.
ordY(mp, cat, y)
A vector of marginal probabilities defining the ordinalized variable.
A numeric vector containing the categories for each respective marginal probability in mp.
mp
A continuous variable to be ordinalized into categories in cat as defined by mp.
cat
A data frame containing the given continuous variable and the ordinalized variable with names y and x, respectively.
mps2cps
# NOT RUN { y<-rnorm(100000) dat<-ordY(mp=c(0.25, 0.5, 0.25), cat=c(1,2,3), y=y) # }
Run the code above in your browser using DataLab