Sampling clusters with surveyselect

Reply
Occasional Contributor
Posts: 8

Sampling clusters with surveyselect

Hello everyone,

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.

PROC SURVEYSELECT

DATA = clusters

METHOD = pps

SAMPSIZE = 24

OUT = sample;

SIZE count;

RUN;

Any ideas would be greatly appreciated!

Sarasvati

Respected Advisor
Posts: 4,828

Re: Sampling clusters with surveyselect

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:

data test;

call streaminit(876561);

do clusterId = 1 to 100;

    clusterSize = rand("POISSON", 6);

    do i = 1 to clusterSize;

        output;

        end;

    end;

keep clusterId;

run;

proc surveyselect data=test method=pps n=8 reps=10 out=samp seed=55540;

cluster clusterId / pps;

run;

proc sql;

select Replicate, count(*) as totalSampleSize

from samp

group by Replicate;

quit;

     Sample

  Replicate   totalSample

     Number          Size

  -----------------------

          1            54

          2            53

          3            50

          4            46

          5            50

          6            55

          7            59

          8            56

          9            52

         10            55

PG

PG
Ask a Question
Discussion stats
  • 1 reply
  • 159 views
  • 0 likes
  • 2 in conversation