BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Dhana18
Obsidian | Level 7

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;

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

This should give you the overlapping conditions:

proc freq data=surrg.merged_male_exposure2;
  tables rect_exp* rect_interc* rectal_exposure /missing list ;
run;

View solution in original post

5 REPLIES 5
PaigeMiller
Diamond | Level 26

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)?

--
Paige Miller
Dhana18
Obsidian | Level 7

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.

PaigeMiller
Diamond | Level 26

Some patients have BOTH rect_exp='1' and rect_interc='1'

--
Paige Miller
ballardw
Super User

This should give you the overlapping conditions:

proc freq data=surrg.merged_male_exposure2;
  tables rect_exp* rect_interc* rectal_exposure /missing list ;
run;
novinosrin
Tourmaline | Level 20

syntactically my eyes can't notice anything

logically i don't know

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 730 views
  • 0 likes
  • 4 in conversation