Maybe this helps?
http://www.stata.com/statalist/archive/2009-10/msg00203.html
On Sat, Dec 5, 2009 at 11:59 AM, Austin Nichols <[email protected]> wrote:
> What is the purpose of this whole exercise? I cannot tell from:
> ... convert a decimal number into binary variables (patterns represent
> the number from 0 to 7 in binary format)
> ...I want to create a program where the number of variables is not
> fixed and can be large
>
> If you tell us what the ultimate goal is, you may get better advice.
>
> On Sat, Dec 5, 2009 at 9:54 AM, Martin Weiss <[email protected]> wrote:
>>
>> <>
>>
>> Sounds like -egen, group()-...
>>
>>
>> HTH
>> Martin
>>
>> -----Original Message-----
>> From: [email protected]
>> [mailto:[email protected]] On Behalf Of Jean-Benoit
>> Hardouin
>> Sent: Samstag, 5. Dezember 2009 13:45
>> To: [email protected]
>> Subject: st: convert decimal number in binary format
>>
>> Dear all,
>> I search an idea to create variables which represents all the possible
>> pattern of responses to a set of binary variables, for example with 3
>> variables :
>>
>> var1 var2 var3
>> 0 0 0
>> 0 0 1
>> 0 1 0
>> 0 1 1
>> 1 0 0
>> 1 0 1
>> 1 1 0
>> 1 1 1
>>
>> I have searched a command to convert a decimal number in binary format (here
>> the responses patterns represents the number from 0 to 7 in binary format)
>> but I have not find any such command.
>>
>> I have no simple idea to create such variables (I want to create a programme
>> where the number of variables is not fixed and can be large).
>>
>> Has someone an idea to help me ?
>> Best,
>> Jean-Benoit
>>
>
*
* 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/