The function transforms the standard normal variable to an ordinal variable with a specified probability for each category.
ordinalize(pvec, z)
Arguments
pvec: A vector of probabilities for an ordinal variable. The i-th element of the pvec is the cumulative probability defining the marginal distribution of the ordinal variable. If the variable has k categories, the i-th element of pvec will contain k-1 probabilities. The k-th element is implicitly 1.
z: A vector of samples from the standard normal distribution.