The SURVEYFREQ Procedure

Example 97.1 Two-Way Tables

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 97.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 97.1.1: Data Summary and Stratum Information

Student Information System Survey

The SURVEYFREQ Procedure

Data Summary
Number of Strata 6
Number of Clusters 370
Number of Observations 1850
Sum of Weights 38899.6482

Stratum Information
Stratum
Index
State NewUser Number of
Obs
Number of
Clusters
1 GA Renewal Customer 315 63
2 GA New Customer 355 71
3 NC Renewal Customer 280 56
4 NC New Customer 420 84
5 SC Renewal Customer 210 42
6 SC New Customer 270 54



Output 97.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 97.1.2: Two-Way Table of Department by Response

Table of Department by Response
Department Response Frequency Percent CV for
Percent
Design
Effect
Faculty Very Unsatisfied 209 13.4987 0.0865 2.1586
  Unsatisfied 203 13.0710 0.0868 2.0962
  Neutral 346 22.4127 0.0629 2.1157
  Satisfied 254 16.2006 0.0806 2.3232
  Very Satisfied 98 6.2467 0.1362 2.2842
Admin/Guidance Very Unsatisfied 95 3.6690 0.1277 1.1477
  Unsatisfied 123 4.6854 0.1060 1.0211
  Neutral 235 9.1838 0.0700 0.9166
  Satisfied 201 7.7305 0.0756 0.8848
  Very Satisfied 86 3.3016 0.1252 0.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 97.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 97.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 admin/guidance) and satisfaction with the student information system.

Output 97.1.3: Table of Department by Response with Row Percentages

Student Information System Survey

The SURVEYFREQ Procedure

Table of Department by Response
Department Response Frequency Percent Std Err of
Percent
Row
Percent
Std Err of
Row Percent
Faculty Very Unsatisfied 209 13.4987 1.1675 18.8979 1.6326
  Unsatisfied 203 13.0710 1.1350 18.2992 1.5897
  Neutral 346 22.4127 1.4106 31.3773 1.9705
  Satisfied 254 16.2006 1.3061 22.6805 1.8287
  Very Satisfied 98 6.2467 0.8506 8.7452 1.1918
  Total 1110 71.4297 0.1468 100.000  
Admin/Guidance Very Unsatisfied 95 3.6690 0.4684 12.8419 1.6374
  Unsatisfied 123 4.6854 0.4966 16.3995 1.7446
  Neutral 235 9.1838 0.6430 32.1447 2.2300
  Satisfied 201 7.7305 0.5842 27.0579 2.0406
  Very Satisfied 86 3.3016 0.4133 11.5560 1.4466
  Total 740 28.5703 0.1468 100.000  
Total Very Unsatisfied 304 17.1676 1.2872    
  Unsatisfied 326 17.7564 1.2712    
  Neutral 581 31.5965 1.5795    
  Satisfied 455 23.9311 1.4761    
  Very Satisfied 184 9.5483 0.9523    
  Total 1850 100.000      



Output 97.1.4: Wald Chi-Square Test

Wald Chi-Square Test
Chi-Square 11.4454
   
F Value 2.8613
Num DF 4
Den DF 364
Pr > F 0.0234
   
Adj F Value 2.8378
Num DF 4
Den DF 361
Pr > Adj F 0.0243
Sample Size = 1850