Question

I use PROC SURVEYSELECT in SAS to sample a data set DT, OUT=DT_SAMPLED, but I would also like to have those samples in DT that didn't get selected. May I know if there is a way? Thanks in advance.

Was it helpful?

Solution

You can use the OUTALL statement on PROC SURVEYSELECT, which will output all records with a selected flag for selected records.

proc surveyselect data=sashelp.class outall out=classsamp n=5 seed=7;
run;

proc freq data=classsamp;
tables selected;
run;

You will see 5 selected (1) and 14 unselected (0).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top