BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
UcheOkoro
Lapis Lazuli | Level 10

Hello,

Can one use the ‘keep’ statement to select variables of interest from a survey data (particularly BRFSS data) into a subset dataset?

The following is my SAS code.

Thank you

 

 Data BRFSS2018b3;
 Set BRFSS2018b;
 SEX=SEX1;
 keep IYEAR SEQNO _AGE80 _STSTR _psu _LLCPWT MEDCOST HLTHPLN1  EMPLOY1 INCOME2 _EDUCAG EMPLOY1  _RACE SEX;
;RUN;
1 ACCEPTED SOLUTION

Accepted Solutions
4 REPLIES 4
ballardw
Super User

Yes.

Basic response would be "try it an see".

 

UcheOkoro
Lapis Lazuli | Level 10

 

Thank you so much for your prompt response.

My main concern was about the  weights. So the weights are not affected as long as I am not creating a subset within a variable, right?

Reeza
Super User
You need to include the weights for the correct downstream analysis.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 949 views
  • 0 likes
  • 3 in conversation