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

No - SAS did not explode.

I need you give me a full syntax of PROC SURVEYSELECT will select Random Samples. 

 

Reeza
Super User

@PhanS wrote:

No - SAS did not explode.

I need you give me a full syntax of PROC SURVEYSELECT will select Random Samples. 

 


You can check the SAS documentation with the examples section first and make an attempt. 

 

If you need things, you usually pay for them. If you do need a consultant feel free to PM me.

 

 If you want help, well, help is free as long as you respectfully phrase your questions and comments but it doesn't mean doing your work for you or providing full working code to solve ambiguous problems on demand.

PhanS
Obsidian | Level 7

Hi Reeza,

 

Sorry, if you feel I am disrespect you. I don't mean this to you and anyone. My English is not primary.

And thanks for your help/comment.

 

Phan S.

 

ChrisNZ
Tourmaline | Level 20

what do you mean not working? You have the full code including the (working) output.

ballardw
Super User

In longitudinal data collection you are more likely to have multiple data sets hopefully with a variable to contain the period identification.

 

data test1;
input id $ fd cl hs hl ;
year=2002;
datalines; 
1 1 1 0 .  
2 1 0 1 1 
3 1 . 0 0  
5 1 1 1 0 
;
run;

data test2;
input id $ fd cl hs hl ;
year=2003;
datalines; 
1 1 1 0 1  
2 1 0 0 . 
3 0 0 1 0  
5 0 0 1 0 
;
run;

data test3;
input id $ fd cl hs hl ;
year=2005;
datalines; 
1 0 1 1 1  
2 1 1 1 1 
3 0 0 1 0  
4 1 1 1 0 
;
run;

 

(yes I intentionally don't have id 5 in the third set. It happens with longitudinal studies - if your data doesn't have that thank the stars)

which you combine with append or set:

data all;
   set test1 test2 test3;
run;

Which lends itself (actually in the last data step) to creating one or more variables that have values based on fd cl hs hl. If you variable are 0/1 with 1 =yes then sum (fd,cl,hs,hl); gives the number of "yes" per respondent.

 

 

then summarize that data.

 

It isn't clear from your example if "each year" means the same client in every year, or if any client in the year had a response.

 

Depending on which what your combinations of each year and a client or any client or what ever, then summarize with Proc means/summary with year or id (or both) as class variables.

PhanS
Obsidian | Level 7

Dear Ballardw,

 

Thanks you for your time and I am going to test.

 

Phan S.

SAS Innovate 2025: Call for Content

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 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 20 replies
  • 1816 views
  • 0 likes
  • 4 in conversation