I'm hoping to get some help with how to best "clean" my initial data that contains string variables with particular issue below...
I am reviewing the use of naloxone to reverse opioid overdose in patients who present to the emergency department. Since there are various routes that this antidote can be administered, data was collected on route of administration. Unfortunately, the route of administration was recorded as a string variable. When I find individual patients who received only one route, there is no issue. I am having issues when patients receive the antidote via multiple routes. If a patient received intranasal AND intravenous naloxone it will list them as "intranasal, intravenous" in string format which assigns a different numeric value than if it were either one alone.
I would like to assign something like 1=intranasal, 2=intravenous, 3=nebulization in order to further analyze the data for tabulation. Currently any new combination of routes assigns a new value using the "encode" command. Does anyone have suggestions on how to clean up this issue? I'm hoping that this does not require manual manipulation.
Also I am having issues with formatting date and time of medication administration:
For example, current formatĀ reads "6/23/2014 14:00" but I can't seem to use the gen date command. Is this because I need to separate time from date? Is there another command line that incorporates both?
Thanks for any help you all can provide!
Paul