The LOGISTIC Procedure

Example 74.4 Nominal Response Data: Generalized Logits Model

(View the complete code for this example.)

Over the course of one school year, third graders from three different schools are exposed to three different styles of mathematics instruction: a self-paced computer-learning style, a team approach, and a traditional class approach. The students are asked which style they prefer and their responses, classified by the type of program they are in (a regular school day versus a regular day supplemented with an afternoon school program), are displayed in Table 74.15. The data set is from Stokes, Davis, and Koch (2012), and is also analyzed in the section Generalized Logits Model in Chapter 32: The CATMOD Procedure.

Table 74.15: School Program Data

  

Learning Style Preference

School

Program

Self

Team

Class

1

Regular

10

17

26

1

Afternoon

5

12

50

2

Regular

21

17

26

2

Afternoon

16

12

36

3

Regular

15

15

16

3

Afternoon

12

12

20


The levels of the response variable (self, team, and class) have no essential ordering, so a logistic regression is performed on the generalized logits. The model to be fit is

where is the probability that a student in school h and program i prefers teaching style j, , and style r is the baseline style (in this case, class). There are separate sets of intercept parameters and regression parameters for each logit, and the vector is the set of explanatory variables for the hith population. Thus, two logits are modeled for each school and program combination: the logit comparing self to class and the logit comparing team to class.

The following statements create the data set school and request the analysis. The LINK=GLOGIT option forms the generalized logits. The response variable option ORDER=DATA means that the response variable levels are ordered as they exist in the data set: self, team, and class; thus, the logits are formed by comparing self to class and by comparing team to class. The ODDSRATIO statement produces odds ratios in the presence of interactions, and a graphical display of the requested odds ratios is produced when ODS Graphics is enabled.

data school;
   length Program $ 9;
   input School Program $ Style $ Count @@;
   datalines;
1 regular   self 10  1 regular   team 17  1 regular   class 26
1 afternoon self  5  1 afternoon team 12  1 afternoon class 50
2 regular   self 21  2 regular   team 17  2 regular   class 26
2 afternoon self 16  2 afternoon team 12  2 afternoon class 36
3 regular   self 15  3 regular   team 15  3 regular   class 16
3 afternoon self 12  3 afternoon team 12  3 afternoon class 20
;
ods graphics on;
proc logistic data=school;
   freq Count;
   class School Program(ref=first);
   model Style(order=data)=School Program School*Program / link=glogit;
   oddsratio program;
run;

Summary information about the model, the response variable, and the classification variables are displayed in Output 74.4.1.

Output 74.4.1: Analysis of Saturated Model

The LOGISTIC Procedure

Model Information
Data SetWORK.SCHOOL
Response VariableStyle
Number of Response Levels3
Frequency VariableCount
Modelgeneralized logit
Optimization TechniqueNewton-Raphson

Number of Observations Read18
Number of Observations Used18
Sum of Frequencies Read338
Sum of Frequencies Used338

Response Profile
Ordered
Value
StyleTotal
Frequency
1self79
2team85
3class174

Logits modeled use Style='class' as the reference category.


Class Level Information
ClassValueDesign Variables
School110
 201
 3-1-1
Programafternoon-1 
 regular1 

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


The "Testing Global Null Hypothesis: BETA=0" table in Output 74.4.2 shows that the parameters are significantly different from zero.

Output 74.4.2: Analysis of Saturated Model

Model Fit Statistics
CriterionIntercept OnlyIntercept and
Covariates
AIC699.404689.156
SC707.050735.033
-2 Log L695.404665.156

Testing Global Null Hypothesis: BETA=0
TestChi-SquareDFPr > ChiSq
Likelihood Ratio30.2480100.0008
Score28.3738100.0016
Wald25.6828100.0042


However, the "Type 3 Analysis of Effects" table in Output 74.4.3 shows that the interaction effect is clearly nonsignificant.

Output 74.4.3: Analysis of Saturated Model

Joint Tests
EffectDFWald
Chi-Square
Pr > ChiSq
School414.55220.0057
Program210.48150.0053
School*Program41.74390.7827

Note:Under full-rank parameterizations, Type 3 effect tests are replaced by joint tests. The joint test for an effect is a test that all the parameters associated with that effect are zero. Such joint tests might not be equivalent to Type 3 effect tests under GLM parameterization.


Analysis of Maximum Likelihood Estimates
Parameter  StyleDFEstimateStandard
Error
Wald
Chi-Square
Pr > ChiSq
Intercept  self1-0.80970.148829.5989<.0001
Intercept  team1-0.65850.136623.2449<.0001
School1 self1-0.81940.228112.90660.0003
School1 team1-0.26750.18812.02330.1549
School2 self10.29740.19192.40070.1213
School2 team1-0.10330.18980.29610.5863
Programregular self10.39850.14887.16840.0074
Programregular team10.35370.13666.70710.0096
School*Program1regularself10.27510.22811.45470.2278
School*Program1regularteam10.14740.18810.61430.4332
School*Program2regularself1-0.09980.19190.27020.6032
School*Program2regularteam1-0.01680.18980.00790.9293


The table produced by the ODDSRATIO statement is displayed in Output 74.4.4. The differences between the program preferences are small across all the styles (logits) compared to their variability as displayed by the confidence limits in Output 74.4.5, confirming that the interaction effect is nonsignificant.

Output 74.4.4: Odds Ratios for Style

Odds Ratio Estimates and Wald Confidence Intervals
Odds RatioEstimate95% Confidence Limits
Style self: Program regular vs afternoon at School=13.8461.19012.435
Style team: Program regular vs afternoon at School=12.7241.1326.554
Style self: Program regular vs afternoon at School=21.8170.7984.139
Style team: Program regular vs afternoon at School=21.9620.8024.799
Style self: Program regular vs afternoon at School=31.5620.5724.265
Style team: Program regular vs afternoon at School=31.5620.5724.265


Output 74.4.5: Plot of Odds Ratios for Style

Plot of Odds Ratios for Style


Because the interaction effect is clearly nonsignificant, a main-effects model is fit with the following statements. The EFFECTPLOT statement creates a plot of the predicted values versus the levels of the School variable at each level of the Program variables. The CLM option adds confidence bars, and the NOOBS option suppresses the display of the observations.

proc logistic data=school;
   freq Count;
   class School Program(ref=first);
   model Style(order=data)=School Program / link=glogit;
   effectplot interaction(plotby=Program) / clm noobs;
run;

All of the global fit tests in Output 74.4.6 suggest the model is significant, and the Type 3 tests show that the school and program effects are also significant.

Output 74.4.6: Analysis of Main-Effects Model

The LOGISTIC Procedure

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

Model Fit Statistics
CriterionIntercept OnlyIntercept and
Covariates
AIC699.404682.934
SC707.050713.518
-2 Log L695.404666.934

Testing Global Null Hypothesis: BETA=0
TestChi-SquareDFPr > ChiSq
Likelihood Ratio28.47046<.0001
Score27.119060.0001
Wald25.588160.0003

Type 3 Analysis of Effects
EffectDFWald
Chi-Square
Pr > ChiSq
School414.84240.0050
Program210.91600.0043


The parameter estimates, tests for individual parameters, and odds ratios are displayed in Output 74.4.7. The Program variable has nearly the same effect on both logits, while School=1 has the largest effect of the schools.

Output 74.4.7: Estimates

Analysis of Maximum Likelihood Estimates
Parameter StyleDFEstimateStandard
Error
Wald
Chi-Square
Pr > ChiSq
Intercept self1-0.79780.146529.6502<.0001
Intercept team1-0.65890.136723.2300<.0001
School1self1-0.79920.219813.22410.0003
School1team1-0.27860.18672.22690.1356
School2self10.28360.18992.23160.1352
School2team1-0.09850.18920.27080.6028
Programregularself10.37370.14107.02720.0080
Programregularteam10.37130.13537.53320.0061

Odds Ratio Estimates
EffectStylePoint Estimate95% Wald
Confidence Limits
School 1 vs 3self0.2690.1270.570
School 1 vs 3team0.5190.2671.010
School 2 vs 3self0.7930.4131.522
School 2 vs 3team0.6220.3171.219
Program regular vs afternoonself2.1121.2153.670
Program regular vs afternoonteam2.1011.2373.571


The interaction plots in Output 74.4.8 show that School=1 and Program=afternoon have a preference for the traditional classroom style. Of course, because these are not simultaneous confidence intervals, the nonoverlapping 95% confidence limits do not take the place of an actual test.

Output 74.4.8: Model-Predicted Probabilities

Model-Predicted Probabilities


Last updated: February 13, 2019