The SURVEYFREQ Procedure

Example 111.1 Two-Way Tables

(View the complete code for this example.)

This example uses the SIS_Survey data set from the section Getting Started: SURVEYFREQ Procedure. The data set contains results from a customer satisfaction survey for a student information system (SIS).

The following PROC SURVEYFREQ statements request a two-way table for Department by Response and customize the crosstabulation table display:

title 'Student Information System Survey';
proc surveyfreq data=SIS_Survey;
   tables  Department * Response / cv deff nowt nostd nototal;
   strata  State NewUser / list;
   cluster School;
   weight  SamplingWeight;
run;

The TABLES statement requests a two-way table of Department by Response. The CV option requests coefficients of variation for the percentage estimates. The DEFF option requests design effects for the percentage estimates. The NOWT option suppresses display of the weighted frequencies, and the NOSTD option suppresses display of standard errors for the estimates. The NOTOTAL option suppresses the row totals, column totals, and overall totals.

The STRATA, CLUSTER, and WEIGHT statements provide sample design information for the procedure, so that the analysis is done according to the sample design used for the survey. The STRATA statement names the variables State and NewUser, which identify the first-stage strata. The LIST option in the STRATA statement requests a "Stratum Information" table. The CLUSTER statement names the variable School, which identifies the clusters (primary sampling units). The WEIGHT statement names the sampling weight variable.

Output 111.1.1 displays the "Data Summary" and "Stratum Information" tables produced by PROC SURVEYFREQ. The "Stratum Information" table lists the six strata in the survey and shows the number of observations and the number of clusters (schools) in each stratum.

Output 111.1.1: Data Summary and Stratum Information

Student Information System Survey

The SURVEYFREQ Procedure

Data Summary
Number of Strata6
Number of Clusters370
Number of Observations1850
Sum of Weights38899.6482

Stratum Information
Stratum
Index
StateNewUserNumber of
Obs
Number of
Clusters
1GARenewal Customer31563
2GANew Customer35571
3NCRenewal Customer28056
4NCNew Customer42084
5SCRenewal Customer21042
6SCNew Customer27054


Output 111.1.2 displays the two-way table of Department by Response. According to the TABLES statement options that are specified, this two-way table includes coefficients of variation and design effects for the percentage estimates, and it does not show the weighted frequencies or the standard errors of the estimates. It also does not show the row, column, and overall totals.

Output 111.1.2: Two-Way Table of Department by Response

Table of Department by Response
DepartmentResponseFrequencyPercentCV for
Percent
Design
Effect
FacultyVery Unsatisfied20913.49870.08652.1586
 Unsatisfied20313.07100.08682.0962
 Neutral34622.41270.06292.1157
 Satisfied25416.20060.08062.3232
 Very Satisfied986.24670.13622.2842
Admin/GuidanceVery Unsatisfied953.66900.12771.1477
 Unsatisfied1234.68540.10601.0211
 Neutral2359.18380.07000.9166
 Satisfied2017.73050.07560.8848
 Very Satisfied863.30160.12520.9892


The following PROC SURVEYFREQ statements request a two-way table of Department by Response that includes row percentages, and also a Wald chi-square test of association between the two table variables:

title 'Student Information System Survey';
proc surveyfreq data=SIS_Survey nosummary;
   tables  Department * Response / row nowt wchisq;
   strata  State NewUser;
   cluster School;
   weight  SamplingWeight;
run;

Output 111.1.3 displays the two-way table. The row percentages show the distribution of Response for Department = 'Faculty' and for Department = 'Admin/Guidance'. This is equivalent to a domain (subpopulation) analysis of Response, where the domains are Department = 'Faculty' and Department = 'Admin/Guidance'.

Output 111.1.4 displays the Wald chi-square test of association between Department and Response. The Wald chi-square is 11.44, and the corresponding adjusted F value is 2.84 with a p-value of 0.0243. This indicates a significant association between department (faculty or administration/guidance) and satisfaction with the student information system.

Output 111.1.3: Table of Department by Response with Row Percentages

Student Information System Survey

The SURVEYFREQ Procedure

Table of Department by Response
DepartmentResponseFrequencyPercentStd Err of
Percent
Row
Percent
Std Err of
Row Percent
FacultyVery Unsatisfied20913.49871.167518.89791.6326
 Unsatisfied20313.07101.135018.29921.5897
 Neutral34622.41271.410631.37731.9705
 Satisfied25416.20061.306122.68051.8287
 Very Satisfied986.24670.85068.74521.1918
 Total111071.42970.1468100.0000 
Admin/GuidanceVery Unsatisfied953.66900.468412.84191.6374
 Unsatisfied1234.68540.496616.39951.7446
 Neutral2359.18380.643032.14472.2300
 Satisfied2017.73050.584227.05792.0406
 Very Satisfied863.30160.413311.55601.4466
 Total74028.57030.1468100.0000 
TotalVery Unsatisfied30417.16761.2872  
 Unsatisfied32617.75641.2712  
 Neutral58131.59651.5795  
 Satisfied45523.93111.4761  
 Very Satisfied1849.54830.9523  
 Total1850100.0000   


Output 111.1.4: Wald Chi-Square Test

Wald Chi-Square Test
Chi-Square11.4454
  
F Value2.8613
Num DF4
Den DF364
Pr > F0.0234
  
Adj F Value2.8378
Num DF4
Den DF361
Pr > Adj F0.0243
Sample Size = 1850