I would appreciate your help:
I am looking to generate a new variable that is a sum of several continuous variables and a substraction of one (or more). The total value needs to be calculated for each individual case (row) separately.
For example:
(ID_01) var01 + var02 +var03 - var04 = new_variable
(ID_02) var01 + var02 +var03 - var04 = new_variable
(ID_03) var01 + var02 +var03 - var04 = new_variable
What would be the best approach. I have attempted this following guidance but I seem to get a total for all individual cases.
I am looking to generate a new variable that is a sum of several continuous variables and a substraction of one (or more). The total value needs to be calculated for each individual case (row) separately.
For example:
(ID_01) var01 + var02 +var03 - var04 = new_variable
(ID_02) var01 + var02 +var03 - var04 = new_variable
(ID_03) var01 + var02 +var03 - var04 = new_variable
What would be the best approach. I have attempted this following guidance but I seem to get a total for all individual cases.
Comment