[R] ordinal data simulation

David Winsemius dwinsemius at comcast.net
Thu Dec 1 15:02:50 CET 2011


On Dec 1, 2011, at 2:06 AM, yuying shi wrote:

> Dear all,
>   I am doing an ordinal data simulation. I have a question  
> regarding the cut off values between categories. Suppose I have  
> three categories, if I do regression, there should be two cut off  
> values. I find some simulation code for the ordinal data. However,  
> they usually only generate a uniform random number and compare the  
> probability with the random number.

That's not a good description of what they are doing.

> Could any one be so kind to tell me the rational behind it. I don't  
> know why we need a random number rather than  just  two fixed cut  
> off values.

One way to generate a random categorical variable constrained to three  
values would just be to take a uniform variate on the interval [0,1]  
and classify it based on whether which of the three segments it is in  
for 0 < a < b < 1. This really is not an appropriate question for  
rhelp so you are advised to submit further such questions somewhere  
they are solicited such as statsexchange.com.

-- 

David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list