BookmarkSubscribeRSS Feed
Ragineejoshi
Fluorite | Level 6

Hi SAS Experts,

I have a question if you can help me out with that?

 

if you have a variable with different values in individual studies, how will you pool them?

like in one study sex = 1 mean Male while in other sex = 2 means male.

 

Please help.

regards

6 REPLIES 6
Ragineejoshi
Fluorite | Level 6

Thank you so much for you answer but I am still not clear about that..

 

Can you please elaborate this issue in detail as this is one of the interview questions I have to prepare for..

 

PaigeMiller
Diamond | Level 26

You have to look at the different data sets and then develop a logic that allows you to combine the data sets and/or modify the values in some meaningful way.

--
Paige Miller
Reeza
Super User

There is no automated way to do this. Personally, I would first clean and synthesize each data set individually and then combine them to the same data set. The difficulty is combining data sets that have M/F for example and M/F/FtM/MtF/etc. 

 

FYI - if you don't know how you'll deal with a situation, you need an answer for the interviewer anyways. Make sure you have an answer prepared for the questions you don't know the answer to, or admit that you don't know the answer, or ask to come back to it later. 

 


@Ragineejoshi wrote:

Thank you so much for you answer but I am still not clear about that..

 

Can you please elaborate this issue in detail as this is one of the interview questions I have to prepare for..

 


 

Tom
Super User Tom
Super User

Pick a target structure that can handle the data you want and map both to that common standard.

 

For your example you might want to just use the strings MALE and FEMALE instead of codes.  

 

data study1_demog;
  set libref1.demog;
  length gender $7;
  if sex=1 then gender='MALE';
  else if sex=2 then gender='FEMALE';
  drop sex;
run;

data study2_demog;
  set libref2.demog;
  length gender $7;
  if sex=2 then gender='FEMALE';
  else if sex=1 then gender='MALE';
  drop sex;
run;

data both;
  set study1_demog study2_demog;
run;

proc freq;
  tables gender;
run;
Ragineejoshi
Fluorite | Level 6

Thank you so much.. ?I understand it clearly.. Now i can explain.. thanks alot.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 1751 views
  • 1 like
  • 5 in conversation