BookmarkSubscribeRSS Feed
deleted_user
Not applicable
i would like to output multiple sample datasets using proc surveyselect.

That's to create 3 sample datasets with a 30,20,50 split from the original dataset.

Thanks and regards,
Thabiso
2 REPLIES 2
data_null__
Jade | Level 19
I'm not sure but I don't think it is possible to output more than one sample data set from PROC SURVEYSELECT. However you can do even better and create three samples in the same data set.

[pre]
proc surveyselect data=sashelp.class out=class3 rate=1 rep=3;
run;
proc surveyselect data=class3 out=sample3 n=(3,2,5);
strata rep:;
run;
proc print;
run;
[/pre]

[pre]
Selection Sampling
Obs Replicate Name Sex Age Height Weight Prob Weight

1 1 Alice F 13 56.5 84.0 0.15789 6.33333
2 1 Robert M 12 64.8 128.0 0.15789 6.33333
3 1 Ronald M 15 67.0 133.0 0.15789 6.33333
4 2 Louise F 12 56.3 77.0 0.10526 9.50000
5 2 Robert M 12 64.8 128.0 0.10526 9.50000
6 3 Henry M 14 63.5 102.5 0.26316 3.80000
7 3 Jeffrey M 13 62.5 84.0 0.26316 3.80000
8 3 Louise F 12 56.3 77.0 0.26316 3.80000
9 3 Robert M 12 64.8 128.0 0.26316 3.80000
10 3 Thomas M 11 57.5 85.0 0.26316 3.80000
[/pre]
Ksharp
Super User
It base what method you want?

Such as simple random sample.
[pre]
proc surveyselect data=.. out=... method=srs sample_size=50;
run;

[/pre]



Ksharp

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!

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