Helllo! I am a research student that is working with survey data to examine the co-occurrence of itch with other co-morbidities. Basically, I am looking at whether or not itch presents with other comorbidities such as PulmonaryCardiac pre- and post-survey. The following code, for example, I think, was used to delineate that: if(Pre_PulmonaryCardiac = 0 & Post_PulmonaryCardiac = 1) then PulmonaryCardiac = 1; else if(Pre_PulmonaryCardiac = 1 & Post_PulmonaryCardiac = 0) then PulmonaryCardiac = 2; else if(Pre_PulmonaryCardiac = 1 & Post_PulmonaryCardiac = 1) then PulmonaryCardiac = 3; else PulmonaryCardiac = 0; I'm now trying to create a combined frequency table of results to examine whether itch presented with PulmonaryCardiac regardless of whether its pre- or post-survey. In other words, I want to develop a format that combines any patients that have any instance of a particular variable and set that to 1, if no then 0. The code I am currently utilizing does not give me the right combined results: proc freq data = ITCH.CROSS_MERGED1; where PulmonaryCardiac = 0 | PulmonaryCardiac = 2; tables rMSA_Q_12 * PulmonaryCardiac / chisq; format PulmonaryCardiac FORMAT_FOR_COMPOSITES. rMSA_Q_12 rMSA_2bin.; How should I format a code that would allow me to get frequencies for: (1) no Dx pre and post (2) Dx pre, post, whereever?
... View more