Hello everyone, I am new here. I intend to create a new variable (say X) conditioned on the values of four other binary variables (A, B, C, D).
X will range from1 to 16, as in the above table. For instance X = 1 if A=1, B=1, C=1 and D=1 simultaneously. I would appreciate it if someone could tell me how to do it.
With sincere appreciation
X will range from1 to 16, as in the above table. For instance X = 1 if A=1, B=1, C=1 and D=1 simultaneously. I would appreciate it if someone could tell me how to do it.
With sincere appreciation
| A | B | C | D | x | |
| 1 | 1 | 1 | 1 | 1 | |
| 0 | 1 | 1 | 1 | 2 | |
| 1 | 0 | 1 | 1 | 3 | |
| 1 | 1 | 0 | 1 | 4 | |
| 1 | 1 | 1 | 0 | 5 | |
| 0 | 0 | 1 | 1 | 6 | |
| 0 | 1 | 0 | 1 | 7 | |
| 0 | 1 | 1 | 0 | 8 | |
| 1 | 0 | 0 | 1 | 9 | |
| 1 | 0 | 1 | 0 | 10 | |
| 1 | 1 | 0 | 0 | 11 | |
| 1 | 0 | 0 | 0 | 12 | |
| 0 | 1 | 0 | 0 | 13 | |
| 0 | 0 | 1 | 0 | 14 | |
| 0 | 0 | 0 | 1 | 15 | |
| 0 | 0 | 0 | 0 | 16 | |

Comment