Statalist


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

st: convert decimal number in binary format


From   Jean-Benoit Hardouin <[email protected]>
To   [email protected]
Subject   st: convert decimal number in binary format
Date   Sat, 05 Dec 2009 13:45:26 +0100

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


--

Jean-Benoit Hardouin, PhD
Maitre de Conférences - Assistant Professor
EA 4275 "Biostatistics, Clinical Research and Subjective Measures in Health Sciences"
http://www.sante.univ-nantes.fr/biostat/

Departement of Biomathematics and Biostatistics
Faculty of Pharmaceutical Sciences
University of Nantes
1, rue Gaston Veil - BP 53508 44035 Nantes Cedex 1 - FRANCE Email : [email protected] Personal website : http://www.anaqol.org


*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index