Hello,
I am a new user of PROC SURVEYSELECT in Base SAS 9.4 and I need to set the sample size to be 10% of the total population size. I don't need to stratify the population. How would I set the samp size option to execute PROC SURVEYSELECT on only that 10%? Would it be as simple as the sampsize option below? Thank you in advance for your help - I really appreciate it!
proc surveyselect data=other_list out=elos1
sampsize=0.1
seed=&seed.;
run;
SAMPSIZE generates an error that it needs an integer, so SAMPRATE will be what you need. And 0.1 is 10%.
Hi Reeza,
I don't know if I should be using sampsize=0.1 or samprate=0.1. Can you advise which one will yield a 10% sample of the population?
Thanks,
Eric
SAMPSIZE generates an error that it needs an integer, so SAMPRATE will be what you need. And 0.1 is 10%.
Is there also a way to have multiple constraints in a PROC SURVEY SELECT like this? I have a list of factors that all have to be >0 for to meet the criteria for inclusion in the sample population. I can't find an example of this anywhere. Thank you again for all your help!
proc surveyselect data=other_list (where = (factor4>0) and (factor5>0)) out=test samprate=0.1 seed=&seed.;
run;
Reeza,
I tried this but it was an invalid use of the AND operator. Is there a way to do a list of multiple constraints in a PROC SURVEYSELECT step so that ALL factors that must be >0 are included? Thanks!
proc surveyselect data=other_list (where = (factor4>0) and (factor5>0)) out=test samprate=0.1 seed=&seed.;
run;
(where = (factor4>0 and factor5>0))
You had brackets too early, closing the WHERE condition, I think. Try the above.
Unfortunately you're stuck listing the factors but you can check if the max is 0 and that should be enough?
Untested.
(where = (not max(factor1, factor2, factor3, ... factor9) = 0));
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.