Hello, I have a dataset with multiple medications listed per study_id. Please see example below. I would like to create a variable "antidepress" that indicates whether any of the med variables (med1-med7) contain an antidepressant. For example, antidepress would =1 if med1, med2, med3, or med4, etc. = citalopram, or sertraline, etc.
Thank you for your help!
Katie
Code:
input int study_id str34 med1 str33 med2 str28(med3 med4) str16 med5 str15(med6 med7) 4 "cyclobenzaprine" "" "" "" "" "" "" 5 "lorazepam" "promethazine" "trazodone" "" "" "" "" 6 "alprazolam" "eszopiclone" "" "" "" "" "" 9 "cyclobenzaprine" "temazepam" "" "" "" "" "" 12 "citalopram" "" "" "" "" "" "" 16 "cyclobenzaprine" "" "" "" "" "" "" 23 "amitriptyline" "" "" "" "" "" "" 28 "venlafaxine" "" "" "" "" "" "" 31 "zzzquil" "" "" "" "" "" "" 32 "trazodone" "sertraline" "" "" "" "" ""
Katie

!
Comment