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.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 466 views
  • 0 likes
  • 3 in conversation