In my prior blog, I had references on sample as applicable to statistics. In this blog, I will discuss sampling in SAS.
In SAS, there are three kinds of sampling namely ;
- Systematic sampling
- Simple random sampling with replacement
- Simple random sampling without replacement
In systematic sampling, data in a table is selected in fixed intervals.
In random sampling, data is selected randomly from a table. However, there is a chance the very same row could be selected again, of course, randomly. This phenomenon is called random sampling with replacement.
Random sampling without replacement occurs when a row, if already selected once, is not selected again.
Let us now focus on the actual SAS code that derives samples for these three kinds.
In SAS procedure “surveyselect”, the value in method determines the kind of sample we want. n determines the size of sample.
- sys creates a systematic sample
- urs creates a sample with replacement
- srs creates a sample without replacement
For illustration purpose, taking n=3 and method=sys, I get the following results: