Programming the statistical procedures from SAS

Survey Selection

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 6
Accepted Solution

Survey Selection

Trying to generate a random sample of employee level data for a survey. Want to ensure I have a minimum of 75 people in each sub group like Gender, line of business, age band etc.

Accepted Solutions
Solution
‎03-08-2017 07:44 PM
Grand Advisor
Posts: 10,043

Re: Survey Selection

What is your population size?

 

Generally if you want something representative of a population as a whole then a simple random sample without constraints of sufficient size would work. But if your desired sizes of specific characteristics require disproportionate sampling then you may have to go to stratification on one or more of the characteristics.

 

If this were my project I would likely start with a random sample of around 200 and examine the characteristics of those selected (Proc freq anyone). If that works, we're golden. If I'm close to the desired sizes in the characteristics then increase the sample size a bit.

If one of the characteristics doesn't get close at all then stratification on that variable and with multiple constraints the strata size would need to be larger.

 

 

View solution in original post


All Replies
Grand Advisor
Posts: 16,880

Re: Survey Selection

In each group individually, or in total?

 

ie 75 females age 20-30

or 75 females

75 age 20-30

75 males

 

Either way, take a look at PROC SURVEYSELECT

Occasional Contributor
Posts: 6

Re: Survey Selection

75 female/75 males
75 age 20-30, 75 age 40-50
Not crossed with each other
Occasional Contributor
Posts: 6

Re: Survey Selection

That's a mimum
Grand Advisor
Posts: 9,451

Re: Survey Selection

Is it what you are looking for ?



proc sort data=sashelp.class out=class;
by sex;
run;
proc surveyselect data=class nmin=8 samprate=.1 out=want;
strata sex;
run;

Respected Advisor
Posts: 4,606

Re: Survey Selection

can the same employee be selected in a gender sample group and an age band sample group?

PG
Respected Advisor
Posts: 4,606

Re: Survey Selection

Assuming the answer is yes, here is a method for choosing 2 students per sex and age group:

 

%macro select(dsn, id, crit, nbSel);
proc sort data=&dsn; by &crit; run;

proc sql;
create table strata_&crit as
select 
    &crit, 
    max(0, &nbSel - sum(selected)) as SampleSize
from &dsn
group by &crit;
quit;

proc surveyselect data=&dsn out=sample_&crit sampsize=strata_&crit;
where not selected;
strata &crit;
run;

proc sql;
update &dsn 
set selected = 1 
where &id in (select &id from sample_&crit);
quit;
%mend;

data class;
set sashelp.class;
selected = 0; /*Add this variable to the dataset */
run;


%select(class, name, sex, 2);
%select(class, name, age, 2);
PG
Occasional Contributor
Posts: 6

Re: Survey Selection

I do not want to limit myself to just a select number from each group. I want a sample that is representative of the employee base through the lense of line of business, gender, age, tenure, etc. just looking to ensure I have a minimum number at the least in each group to be able to confidently say women would prefer this over men. Or age band 20-30 is more likely to use the offering we are surveying on
Grand Advisor
Posts: 16,880

Re: Survey Selection

Is 75 from a power analysis?

Occasional Contributor
Posts: 6

Re: Survey Selection

It's based on a response rate assumption. Want to be left with enough sample to see difference in my groups for likert responses differences to be significant
Solution
‎03-08-2017 07:44 PM
Grand Advisor
Posts: 10,043

Re: Survey Selection

What is your population size?

 

Generally if you want something representative of a population as a whole then a simple random sample without constraints of sufficient size would work. But if your desired sizes of specific characteristics require disproportionate sampling then you may have to go to stratification on one or more of the characteristics.

 

If this were my project I would likely start with a random sample of around 200 and examine the characteristics of those selected (Proc freq anyone). If that works, we're golden. If I'm close to the desired sizes in the characteristics then increase the sample size a bit.

If one of the characteristics doesn't get close at all then stratification on that variable and with multiple constraints the strata size would need to be larger.

 

 

Occasional Contributor
Posts: 6

Re: Survey Selection

I ultimately needed to use a combination of solutions! Thank you everyone for your advice!
☑ This topic is SOLVED.

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

Discussion stats
  • 11 replies
  • 127 views
  • 0 likes
  • 5 in conversation