Task 2b: How to Specify the Survey Design to Analyze Subgroups Using SAS

SAS has four survey analysis procedures.  Only two of these, PROC SURVEYMEANS and PROC SURVEYFREQ, allow for proper subgroup (or domain) analyses.  PROC SURVEYMEANS uses a domain statement to specify the subgroup of interest, whereas PROC SURVEYFREQ specifies the subgroup variable within the tables statement.  General templates for using these two procedures to conduct subgroup analyses in SAS are shown below.

 

Template for Analyzing Subgroups using PROC SURVEYMEANS

Code Element
proc surveymeans:

Element 1

         strata sdmvstra ;

Element 2

          cluster SDMVPSU ;

Element 3

         weight <appropriate sample weight variable>;

Element 4

          domain <domain variable>;

Element 5

         <more SAS procedure syntax>;

 

run;

 

 

Using a domain statement in the PROC SURVEYMEANS procedure allows you to identify the subgroup of interest.

 

Template for Analyzing Subgroups using PROC SURVEYMEANS

Code Element
proc surveyfreq:

Element 1

         strata sdmvstra ;

Element 2

          cluster SDMVPSU ;

Element 3

         weight <appropriate sample weight variable>;

Element 4

          tables <domain variable>*<row variable>*<column variable>;

Element 5

         <more SAS procedure syntax>;

 

run;

 

Using a tables statement in the PROC SURVEYFREQ procedure allows you to identify the subgroup of interest such that two-way tables of the row variable by the column variables will be produced for each level of the domain and variable.

 

close window icon Close Window to return to module page.