The SURVEYFREQ Procedure

Example 111.2 Multiway Tables (Domain Analysis)

(View the complete code for this example.)

Continuing to use the SIS_Survey data set from the section Getting Started: SURVEYFREQ Procedure, this example shows how to produce multiway tables. The following PROC SURVEYFREQ statements request a table of Department by SchoolType by Response for the student information system survey:

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

The TABLES statement requests a multiway table with SchoolType as the row variable, Response as the column variable, and Department as the layer variable. This request produces a separate two-way table of SchoolType by Response for each level of the variable Department. The TABLES statement also requests a two-way table of SchoolType by Response, which totals the multiway table over both levels of Department. As in the previous examples, the STRATA, CLUSTER, and WEIGHT statements provide sample design information, so that the analysis will be done according to the design used for this survey.

Output 111.2.1 displays the multiway table produced by PROC SURVEYFREQ, which includes a table of SchoolType by Response for Department = 'Faculty' and for Department = 'Admin/Guidance'. This is equivalent to a domain (subpopulation) analysis of SchoolType by Response, where the domains are Department = 'Faculty' and Department = 'Admin/Guidance'.

Output 111.2.1: Multiway Table of Department by SchoolType by Response

Student Information System Survey

The SURVEYFREQ Procedure

Table of SchoolType by Response
Controlling for Department=Faculty
SchoolTypeResponseFrequencyWeighted
Frequency
Std Err of
Wgt Freq
PercentStd Err of
Percent
Middle SchoolVery Unsatisfied741846301.226376.64431.0838
 Unsatisfied781929283.114766.94281.0201
 Neutral1303289407.8085511.83691.4652
 Satisfied1132795368.8508710.05971.3288
 Very Satisfied551378261.633114.95780.9411
 Total45011237714.9712040.44152.5713
High SchoolVery Unsatisfied1353405389.4231312.25361.3987
 Unsatisfied1253155384.5673411.35631.3809
 Neutral2165429489.3782619.54041.7564
 Satisfied1413507417.5477312.62081.5040
 Very Satisfied431052221.593673.78740.7984
 Total66016549719.6153659.55852.5713
TotalVery Unsatisfied2095251454.8259818.89791.6326
 Unsatisfied2035085442.3903218.29921.5897
 Neutral3468718550.8173531.37731.9705
 Satisfied2546302507.0171122.68051.8287
 Very Satisfied982430330.976028.74521.1918
 Total111027786119.25529100.0000 

Table of SchoolType by Response
Controlling for Department=Admin/Guidance
SchoolTypeResponseFrequencyWeighted
Frequency
Std Err of
Wgt Freq
PercentStd Err of
Percent
Middle SchoolVery Unsatisfied42649.43427133.061945.84351.1947
 Unsatisfied31460.35557100.801584.14220.9076
 Neutral1041568186.9994614.10421.6804
 Satisfied841269165.7112711.41421.4896
 Very Satisfied39574.93878110.372435.17320.9942
 Total3004521287.8683240.67742.5801
High SchoolVery Unsatisfied53777.77725136.418696.99831.2285
 Unsatisfied921362175.4086212.25731.5806
 Neutral1312005212.3480418.04041.8990
 Satisfied1171739190.0779815.64371.7118
 Very Satisfied47709.37033126.543946.38281.1371
 Total4406593288.9248359.32262.5801
TotalVery Unsatisfied951427182.2813212.84191.6374
 Unsatisfied1231823193.4304516.39951.7446
 Neutral2353572250.2273932.14472.2300
 Satisfied2013007226.8231127.05792.0406
 Very Satisfied861284160.8343411.55601.4466
 Total7401111460.78850100.0000