I have a data table with several data columns with binary 0/1 responses (character, nominal). I want to create a new column (numerical, continuous) where I am counting the instances of "1"s in these columns.
can someone help me create a script to create this column? I feel like this should be easy but I am running into road blocks. Do I have to convert my character columns to numerical/continuous columns and do summation formula? Thank you!
Example table
| infection (character, nominal) | blood clot (character, nominal) | surgery (character, nominal) | NEW COLUMN: number of complications (numerical, continuous) |
| 0 | 1 | 1 | 2 |
1 | 1 | 1 | 3 |
| 1 | 0 | 0 | 1 |
| 0 | 1 | 0 | 1 |