seed option in random sampling

Accepted Solution Solved
Reply
Contributor
Posts: 62
Accepted Solution

seed option in random sampling

Hello,

I have to run this code with multiples samprate (10%, 25%. 33,333%. 50%, 66,66%, 75%, 90%):

proc surveyselect data = have out = want method = srs samprate = .5 seed = 878787;

PackageID;

run;

Does it change anything in my sampling if I keep the same seed? I know that the seed allows me to replicate the same output, if I need to, but does it create a kind of bias in my sampling (i.e. does it affecte the way the sampling works or does his job?)?

Thank you in advance.


Accepted Solutions
Solution
‎07-24-2014 05:15 PM
Respected Advisor
Posts: 4,654

Re: seed option in random sampling

I don't quite see the point of stratifying in SRS with proportional allocation, but anyway...

You could circumvent the multiple seed question and do all your sampling in sequence from a single seed:

data hav;

set have;

do _RATE_ = 0.1, 0.25, 0.33333, 0.5, 0.66667, 0.75, 0.9;

    output;

    end;

run;

proc sort data=hav; by _RATE_ PackageID; run;

data samprate;

set hav; by _RATE_ PackageID;

if first.PackageID;

run;

proc surveyselect data=hav out=want method=srs samprate=samprate seed=878787;

strata _RATE_ PackageID;

run;

(untested)

PG

PG

View solution in original post


All Replies
Contributor
Posts: 62

Re: seed option in random sampling

***************************

proc surveyselect data = have out = want method = srs samprate = .5 seed = 878787;

strata PackageID;

run;

Super User
Posts: 10,516

Re: seed option in random sampling

Have you generated separate data sets and done any comparison?

Solution
‎07-24-2014 05:15 PM
Respected Advisor
Posts: 4,654

Re: seed option in random sampling

I don't quite see the point of stratifying in SRS with proportional allocation, but anyway...

You could circumvent the multiple seed question and do all your sampling in sequence from a single seed:

data hav;

set have;

do _RATE_ = 0.1, 0.25, 0.33333, 0.5, 0.66667, 0.75, 0.9;

    output;

    end;

run;

proc sort data=hav; by _RATE_ PackageID; run;

data samprate;

set hav; by _RATE_ PackageID;

if first.PackageID;

run;

proc surveyselect data=hav out=want method=srs samprate=samprate seed=878787;

strata _RATE_ PackageID;

run;

(untested)

PG

PG
Contributor
Posts: 62

Re: seed option in random sampling


Thank you for your response!

Contributor
Posts: 62

Re: seed option in random sampling

I'm curious about ''I don't quite see the point of stratifying in SRS with proportional allocation, but anyway...''.

Respected Advisor
Posts: 4,654

Re: seed option in random sampling

Well, maybe I'm missing something. The only effect of stratification on Simple Random Sampling with a fixed sampling rate is to spread the samples more evenly among the strata. Without stratification the overall sample size will be the same but the realized sample rate will vary from one stratum to the next.

PG

PG
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 6 replies
  • 307 views
  • 3 likes
  • 3 in conversation