07-27-2014 02:49 PM
I've asked this question in a similar manner in a previous post- but I wanted to clarify what I was asking. I currently have about 7 dummy variables all pertaining to psychological outcome (anxiety, stress, multiple personalities, etc) coded as 1=yes and 0=no. I would like to collapse all of these variables into one "psych condition" variable with 1=yes and 0=no. The variable would get a value of 1 if any of the 7 psychological outcomes had a value of 1. I've tried coding it a few different ways, but every time I overwrite the previous value and end up with every observation having a value of zero. Is there an easier way to do this?
07-27-2014 03:18 PM
if anxiety=1 or stress=1 or personalities=1 or var4=1 or var5=1 or var6=1 or var7=1 then psychological_outcomes=1;
07-28-2014 08:03 AM
Make an array of the dummy variables and use whichn