data surrg.male_exposure2;
set surrg._male_exposure1;
if rect_exp = "1" OR rect_interc = "1" then rectal_exposure = "Yes";
else rectal_exposure = "0";
run;
This should give you the overlapping conditions:
proc freq data=surrg.merged_male_exposure2; tables rect_exp* rect_interc* rectal_exposure /missing list ; run;
Why do you think anything is wrong with it? Can you show us either the SASLOG, or results that are different than what you expect(and explain)?
260 data surrg.merged_male_exposure2;
261 set surrg.merged_male_exposure1;
262 if rect_exp = "1" OR rect_interc = "1" then rectal_exposure = "Yes";
263 run;
NOTE: There were 3439 observations read from the data set SURRG.MERGED_MALE_EXPOSURE1.
NOTE: The data set SURRG.MERGED_MALE_EXPOSURE2 has 3439 observations and 206 variables.
NOTE: DATA statement used (Total process time):
real time 0.50 seconds
cpu time 0.07 seconds
I did a frequency analysis of rect_exp there are 410 patients with that exposure and rect_interc has 263 patients and after this code there should be 473 rectal exposure but it only give me 425. That is wrong.
Some patients have BOTH rect_exp='1' and rect_interc='1'
This should give you the overlapping conditions:
proc freq data=surrg.merged_male_exposure2; tables rect_exp* rect_interc* rectal_exposure /missing list ; run;
syntactically my eyes can't notice anything
logically i don't know
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.