I'm trying to add a constant to a variable based on a value of another variable. In other words I have two variables (Cancer, psa). Cancer 1, 0 (which is yes no) if the patient has cancer I want to add 2.0 to another variable 'psa' which is continuous. If the patient does not have cancer I want to skip over their psa variable value and move to the next case. I think this is a if or ifelse but I'm not sure
My best guess so far:
ifelse(cancer=1,(psa1=psa1+2),(psa1=psa1*1))