08-19-2014 06:17 PM
I have a dataset in which each row contains the cluster ID and the cluster count. I want to do one-stage cluster sampling where I select entire clusters using PPS method. I have worked out the total SS required to determine my parameter (a proportion) with desired confidence level/precision. However, cannot figure out how to specify my sample size using the total count rather than number of clusters.
In this code, I have asked for 24 clusters to be selected using PPS. What i would really like to do is to sample an unknown number of clusters until the total count is 400.
DATA = clusters
METHOD = pps
SAMPSIZE = 24
OUT = sample;
Any ideas would be greatly appreciated!
08-19-2014 09:56 PM
I don't think you can control the total cluster size with surveyselect. You could however generate many replicate samples and pick one that suits you. Look at the following example:
do clusterId = 1 to 100;
clusterSize = rand("POISSON", 6);
do i = 1 to clusterSize;
proc surveyselect data=test method=pps n=8 reps=10 out=samp seed=55540;
cluster clusterId / pps;
select Replicate, count(*) as totalSampleSize
group by Replicate;