|The SURVEYFREQ Procedure|
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:
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 or primary sampling units (PSUs). The WEIGHT statement names the sampling weight variable.
Output 83.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, or schools, in each stratum.
|Number of Strata||6|
|Number of Clusters||370|
|Number of Observations||1850|
|Sum of Weights||38899.6482|
Output 83.1.2 displays the two-way table of Department by Response. According to the TABLES statement options 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.
|Table of Department by Response|
|Department||Response||Frequency||Percent|| CV for
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:
proc surveyfreq data=SIS_Survey nosummary; tables Department * Response / row nowt wchisq; strata State NewUser; cluster School; weight SamplingWeight; run;
Output 83.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 or subpopulation analysis of Response, where the domains are Department = 'Faculty' and Department = 'Admin/Guidance'.
Output 83.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 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.
|Table of Department by Response|
|Department||Response||Frequency||Percent||Std Err of
| Std Err of