Hello everyone
I have a dataset with a variable where the value of each observation on that variable is given by a number. This could be any number: 23, 32345, 3123 etc.
I need to convert these numbers into a binary number. I then want to take each of the digits in the binary sequences and turn them into new variables.
More precisely i want to take the first digit of all the binary sequences and turn them into a new variable. And the same for the second digit, third digit etc.
the first variable created in this way will than be a binary variable that indicates whether each observation had a 1 or 0 on the first digit in their binary sequence.
Do you have any suggestions how to do this?
Thank you,
Jonathan
I have a dataset with a variable where the value of each observation on that variable is given by a number. This could be any number: 23, 32345, 3123 etc.
I need to convert these numbers into a binary number. I then want to take each of the digits in the binary sequences and turn them into new variables.
More precisely i want to take the first digit of all the binary sequences and turn them into a new variable. And the same for the second digit, third digit etc.
the first variable created in this way will than be a binary variable that indicates whether each observation had a 1 or 0 on the first digit in their binary sequence.
Do you have any suggestions how to do this?
Thank you,
Jonathan
Comment