Programming the statistical procedures from SAS

proc surveyselect

Reply
N/A
Posts: 0

proc surveyselect

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
Respected Advisor
Posts: 3,773

Re: proc surveyselect

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]
Grand Advisor
Posts: 9,451

Re: proc surveyselect

It base what method you want?

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

[/pre]



Ksharp
Ask a Question
Discussion stats
  • 2 replies
  • 97 views
  • 0 likes
  • 3 in conversation