Statalist


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

Re: st: RE: convert decimal number in binary format


From   Austin Nichols <austinnichols@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: convert decimal number in binary format
Date   Sat, 5 Dec 2009 12:01:55 -0500

Maybe this helps?
http://www.stata.com/statalist/archive/2009-10/msg00203.html

On Sat, Dec 5, 2009 at 11:59 AM, Austin Nichols <austinnichols@gmail.com> 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 <martin.weiss1@gmx.de> wrote:
>>
>> <>
>>
>> Sounds like -egen, group()-...
>>
>>
>> HTH
>> Martin
>>
>> -----Original Message-----
>> From: owner-statalist@hsphsun2.harvard.edu
>> [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Jean-Benoit
>> Hardouin
>> Sent: Samstag, 5. Dezember 2009 13:45
>> To: statalist@hsphsun2.harvard.edu
>> 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/



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