The SURVEYLOGISTIC Procedure

Getting Started: SURVEYLOGISTIC Procedure

(View the complete code for this example.)

The SURVEYLOGISTIC procedure is similar to the LOGISTIC procedure and other regression procedures in the SAS System. See Chapter 78, The LOGISTIC Procedure, for general information about how to perform logistic regression by using SAS. PROC SURVEYLOGISTIC is designed to handle sample survey data, and thus it incorporates the sample design information into the analysis.

The following example illustrates how to use PROC SURVEYLOGISTIC to perform logistic regression for sample survey data.

In the customer satisfaction survey example in the section Getting Started: SURVEYSELECT Procedure in Chapter 123, The SURVEYSELECT Procedure, an Internet service provider conducts a customer satisfaction survey. The survey population consists of the company’s current subscribers from four states: Alabama (AL), Florida (FL), Georgia (GA), and South Carolina (SC). The company plans to select a sample of customers from this population, interview the selected customers and ask their opinions on customer service, and then make inferences about the entire population of subscribers from the sample data. A stratified sample is selected by using the probability proportional to size (PPS) method. The sample design divides the customers into strata depending on their types ('Old' or 'New') and their states (AL, FL, GA, SC). There are eight strata in all. Within each stratum, customers are selected and interviewed by using the PPS with replacement method, where the size variable is Usage. The stratified PPS sample contains 192 customers. The data are stored in the SAS data set SampleStrata. Figure 1 displays the first 10 observations of this data set.

Figure 1: Stratified PPS Sample (First 10 Observations)

Customer Satisfaction Survey
Stratified PPS Sampling
(First 10 Observations)

ObsStateTypeCustomerIDRatingUsageSamplingWeight
1ALNew24394278Neutral13.1726.358
2ALNew64798692Extremely Unsatisfied15.5322.352
3ALNew75375074Unsatisfied99.113.501
4ALNew262831809Neutral5.4064.228
5ALNew294428658Extremely Satisfied1.17297.488
6ALNew336222949Unsatisfied38.698.970
7ALNew351929023Extremely Satisfied2.72127.475
8ALNew366142640Satisfied2.61132.958
9ALNew371478614Neutral14.3624.173
10ALNew477172230Neutral4.0685.489


In the SAS data set SampleStrata, the variable CustomerID uniquely identifies each customer. The variable State contains the state of the customer’s address. The variable Type equals 'Old' if the customer has subscribed to the service for more than one year; otherwise, the variable Type equals 'New'. The variable Usage contains the customer’s average monthly service usage, in hours. The variable Rating contains the customer’s responses to the survey. The sample design uses an unequal probability sampling method, with the sampling weights stored in the variable SamplingWeight.

The following SAS statements fit a cumulative logistic model between the satisfaction levels and the Internet usage by using the stratified PPS sample:

title 'Customer Satisfaction Survey';
proc surveylogistic data=SampleStrata;
   strata state type/list;
   model Rating (order=internal) = Usage;
   weight SamplingWeight;
run;

The PROC SURVEYLOGISTIC statement invokes the SURVEYLOGISTIC procedure. The STRATA statement specifies the stratification variables State and Type that are used in the sample design. The LIST option requests a summary of the stratification. In the MODEL statement, Rating is the response variable and Usage is the explanatory variable. The ORDER=internal is used for the response variable Rating to ask the procedure to order the response levels by using the internal numerical value (1–5) instead of the formatted character value. The WEIGHT statement specifies the variable SamplingWeight that contains the sampling weights.

The results of this analysis are shown in the following figures.

Figure 2: Stratified PPS Sample, Model Information

Customer Satisfaction Survey

The SURVEYLOGISTIC Procedure

Model Information
Data SetWORK.SAMPLESTRATA 
Response VariableRating 
Number of Response Levels5 
Stratum VariablesState 
 Type 
Number of Strata8 
Weight VariableSamplingWeightSampling Weight
ModelCumulative Logit 
Optimization TechniqueFisher's Scoring 
Variance AdjustmentDegrees of Freedom (DF) 


PROC SURVEYLOGISTIC first lists the following model fitting information and sample design information in Figure 2:

  • The link function is the logit of the cumulative of the lower response categories.

  • The Fisher scoring optimization technique is used to obtain the maximum likelihood estimates for the regression coefficients.

  • The response variable is Rating, which has five response levels.

  • The stratification variables are State and Type.

  • There are eight strata in the sample.

  • The weight variable is SamplingWeight.

  • The variance adjustment method used for the regression coefficients is the default degrees of freedom adjustment.

Figure 3 lists the number of observations in the data set and the number of observations used in the analysis. Since there is no missing value in this example, observations in the entire data set are used in the analysis. The sums of weights are also reported in this table.

Figure 3: Stratified PPS Sample, Number of Observations

Number of Observations Read194
Number of Observations Used194
Sum of Weights Read14200.58
Sum of Weights Used14200.58


The "Response Profile" table in Figure 4 lists the five response levels, their ordered values, and their total frequencies and total weights for each category. Due to the ORDER=INTERNAL option for the response variable Rating, the category "Extremely Unsatisfied" has the Ordered Value 1, the category "Unsatisfied" has the Ordered Value 2, and so on.

Figure 4: Stratified PPS Sample, Response Profile

Response Profile
Ordered
Value
RatingTotal
Frequency
Total
Weight
1Extremely Unsatisfied612049.6278
2Unsatisfied423084.6615
3Neutral492295.9993
4Satisfied333754.7221
5Extremely Satisfied93015.5727

Probabilities modeled are cumulated over the lower Ordered Values.



Figure 5 displays the output of the stratification summary. There are a total of eight strata, and each stratum is defined by the customer types within each state. The table also shows the number of customers within each stratum.

Figure 5: Stratified PPS Sample, Stratification Summary

Stratum Information
Stratum
Index
StateTypeN Obs
1ALNew24
2 Old25
3FLNew25
4 Old23
5GANew24
6 Old25
7SCNew24
8 Old24


Figure 6 shows the iteration algorithm converged to obtain the MLE for this example. The "Model Fit Statistics" table contains the Akaike information criterion (AIC), the Schwarz criterion (SC), and the negative of twice the log likelihood (minus 2 log upper L) for the intercept-only model and the fitted model. AIC and SC can be used to compare different models, and the ones with smaller values are preferred.

Figure 6: Stratified PPS Sample, Model Fitting Information

Model Convergence Status
Convergence criterion (GCONV=1E-8) satisfied.

Model Fit Statistics
CriterionIntercept OnlyIntercept and
Covariates
AIC45064.14444143.526
SC45094.38944181.332
-2 Log L45056.14444133.526


The table "Testing Global Null Hypothesis: BETA=0" in Figure 7 shows the likelihood ratio test, the efficient score test, and the Wald test for testing the significance of the explanatory variable (Usage). All tests are significant.

Figure 7: Stratified PPS Sample

Testing Global Null Hypothesis: BETA=0
TestF ValueNum DFDen DFPr > F
Likelihood Ratio12.9511860.0004
Score108.361186<.0001
Wald5.9311860.0159
NOTE: First-order Rao-Scott design correction 0.9734 applied to the likelihood ratio test.


Figure 8 shows the parameter estimates of the logistic regression and their standard errors.

Figure 8: Stratified PPS Sample, Parameter Estimates

Analysis of Maximum Likelihood Estimates
Parameter EstimateStandard
Error
t ValuePr > |t|
InterceptExtremely Unsatisfied-2.12520.3727-5.70<.0001
InterceptUnsatisfied-0.86490.3616-2.390.0178
InterceptNeutral-0.17680.3645-0.490.6282
InterceptSatisfied1.09530.52552.080.0385
Usage 0.04410.01812.430.0159
NOTE: The degrees of freedom for the t tests is 186.


Figure 9 displays the odds ratio estimate and its confidence intervals.

Figure 9: Stratified PPS Sample, Odds Ratios

Odds Ratio Estimates
EffectPoint Estimate95% Confidence Limits
Usage1.0451.0081.083
NOTE: The degrees of freedom in computing
the confidence limits is 186.


Last updated: October 28, 2020