Both SAS and R provide means of simulating categorical data (see section 1.10.4). Alternatively, it is trivial to write code to do this directly. In this entry, we show how to do it once. In a future entry, we’ll demonstrate writing a SAS Macro (section A.8.1) and a function in R (section B.5.2) to do it repeatedly.SASdata test;p1 = .1; p2 = .2; p3 = .3;do i = 1 to 10000; x = uniform(0);
To leave a comment for the author, please follow the link and comment on their blog: SAS and R.