Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Creating choice indicator!


From   Peter Grand <grand@ihs.ac.at>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: Creating choice indicator!
Date   Tue, 20 Mar 2012 16:51:25 +0000

Dear Statalisters!

How can I create a random binary variable which indicates either only one chosen alternative or none of them within an id variable, e.g. 5 choices for each individual id :


id   chosen
1       0
1       0
1       1
1       0
1       0
2       0
2       0
2       0
2       0
2       0
3       0
3       1
3       0
3       0
3       0


Thank you very much!

Best,

Peter Grand
grand(at)ihs.ac.at
Institute for Advanced Studies
Stumpergasse 56
1060 Vienna

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index