Displaying 1 result from an estimated 1 matches for "tstcutoff".
2013 Apr 25
1
Assigning a variable value based on multiple columns
...iabetes    ESRD    HIV    Contact
1        0            0            NA        0
2        1            0            NA        0
3        NA          1            0        0
4        0            NA          0        1
5        1            1            1        0
I want to generate a column called TSTcutoff based on the values in the row.  TSTcutoff would be the lower of 15 (if Diabetes=ESRD=HIV=Contact=0), 10 (if Diabetes or ESRD=1 AND HIV=Contact=0), or 5 (if HIV OR Contact=1).  I was thinking this could be done with a series of IFELSE statements, but the NA values make this more challenging.  I wan...