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

Hello all,

 

I have a long formatted file, in which every subject has more than one row. For each row, I have several variables, two of them are "ID" and "Visit". Each subject has 5 visits. I have 50 subjects.

 

I want to make a random sampling with replacement, in order to get a larger file, with 100 subjects.

 

The problem is, when I use PROC SURVEYSELECT (which is straightforward), SAS chooses rows, not subjects. I want SAS to sample a subject, and to keep all his rows, rather than randomly selecting rows.

 

Can it be done ? I am pretty much lost here.

 

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
data_null__
Jade | Level 19
  • SAMPLINGUNIT | CLUSTER variables < / options > ;

View solution in original post

4 REPLIES 4
BlueNose
Quartz | Level 8
No. I have too many variables per visit (10 variables * 5 visits will give 50 variables wide).
BlueNose
Quartz | Level 8

I have an idea. Can I save the number of times each subject is selected, and then build different datsets for subjects with number of hits of up to 1, up to 2, etc... and then append these datasets ?

data_null__
Jade | Level 19
  • SAMPLINGUNIT | CLUSTER variables < / options > ;

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 4 replies
  • 596 views
  • 2 likes
  • 3 in conversation