The GENMOD Procedure

Example 45.4 Ordinal Model for Multinomial Data

(View the complete code for this example.)

This example illustrates how you can use the GENMOD procedure to fit a model to data measured on an ordinal scale. The following statements create a SAS data set called Icecream. The data set contains the results of a hypothetical taste test of three brands of ice cream. The three brands are rated for taste on a five-point scale from very good (vg) to very bad (vb). An analysis is performed to assess the differences in the ratings of the three brands. The variable taste contains the ratings, and the variable brand contains the brands tested. The variable count contains the number of testers rating each brand in each category.

The following statements create the Icecream data set:

data Icecream;
   input count brand$ taste$;
   datalines;
70  ice1 vg
71  ice1 g
151 ice1 m
30  ice1 b
46  ice1 vb
20  ice2 vg
36  ice2 g
130 ice2 m
74  ice2 b
70  ice2 vb
50  ice3 vg
55  ice3 g
140 ice3 m
52  ice3 b
50  ice3 vb
;

The following statements fit a cumulative logit model to the ordinal data with the variable taste as the response and the variable brand as a covariate. The variable count is used as a FREQ variable.

proc genmod data=Icecream rorder=data;
   freq count;
   class brand;
   model taste = brand / dist=multinomial
                         link=cumlogit
                         aggregate=brand
                         type1;
   estimate 'LogOR12' brand 1 -1 / exp;
   estimate 'LogOR13' brand 1  0  -1 / exp;
   estimate 'LogOR23' brand 0  1  -1 / exp;
run;

The AGGREGATE=BRAND option in the MODEL statement specifies the variable brand as defining multinomial populations for computing deviances and Pearson chi-squares. The RORDER=DATA option specifies that the taste variable levels be ordered by their order of appearance in the input data set—that is, from very good (vg) to very bad (vb). By default, the response is sorted in increasing ASCII order. Always check the "Response Profiles" table to verify that response levels are appropriately ordered. The TYPE1 option requests a Type 1 test for the significance of the covariate brand.

If is the cumulative probability of the jth or lower taste category, then the odds ratio comparing to is as follows:

See McCullagh and Nelder (1989, Chapter 5) for details on the cumulative logit model. The ESTIMATE statements compute log odds ratios comparing each of brands. The EXP option in the ESTIMATE statements exponentiates the log odds ratios to form odds ratio estimates. Standard errors and confidence intervals are also computed. Output 45.4.1 displays general information about the model and data, the levels of the CLASS variable brand, and the total number of occurrences of the ordered levels of the response variable taste.

Output 45.4.1: Ordinal Model Information

The GENMOD Procedure

Model Information
Data SetWORK.ICECREAM
DistributionMultinomial
Link FunctionCumulative Logit
Dependent Variabletaste
Frequency Weight Variablecount

Class Level Information
ClassLevelsValues
brand3ice1 ice2 ice3

Response Profile
Ordered
Value
tasteTotal
Frequency
1vg140
2g162
3m421
4b156
5vb166


Output 45.4.2 displays estimates of the intercept terms and covariates and associated statistics. The intercept terms correspond to the four cumulative logits defined on the taste categories in the order shown in Output 45.4.1. That is, Intercept1 is the intercept for the first cumulative logit, , Intercept2 is the intercept for the second cumulative logit, , and so forth.

Output 45.4.2: Parameter Estimates

Analysis Of Maximum Likelihood Parameter Estimates
Parameter DFEstimateStandard
Error
Wald 95% Confidence LimitsWald Chi-SquarePr > ChiSq
Intercept1 1-1.85780.1219-2.0967-1.6189232.35<.0001
Intercept2 1-0.86460.1056-1.0716-0.657667.02<.0001
Intercept3 10.92310.10600.71541.130875.87<.0001
Intercept4 11.80780.11911.57432.0413230.32<.0001
brandice110.38470.13700.11620.65327.890.0050
brandice21-0.64570.1397-0.9196-0.371921.36<.0001
brandice300.00000.00000.00000.0000..
Scale 01.00000.00001.00001.0000  

Note:The scale parameter was held fixed.



The Type 1 test displayed in Output 45.4.3 indicates that Brand is highly significant; that is, there are significant differences among the brands. The log odds ratios and odds ratios in the "ESTIMATE Statement Results" table indicate the relative differences among the brands. For example, the odds ratio of 2.8 in the "Exp(LogOR12)" row indicates that the odds of brand 1 being in lower taste categories is 2.8 times the odds of brand 2 being in lower taste categories. Since, in this ordering, the lower categories represent the more favorable taste results, this indicates that brand 1 scored significantly better than brand 2. This is also apparent from the data in this example.

Output 45.4.3: Type 1 Tests and Odds Ratios

LR Statistics For Type 1 Analysis
SourceDevianceDFChi-SquarePr > ChiSq
Intercepts65.9576   
brand9.8654256.09<.0001

Contrast Estimate Results
LabelMean EstimateMeanL'Beta EstimateStandard
Error
AlphaL'BetaChi-SquarePr > ChiSq
Confidence LimitsConfidence Limits
LogOR120.73700.68050.78671.03050.14010.050.75591.305054.11<.0001
Exp(LogOR12)   2.80240.39260.052.12953.6878  
LogOR130.59500.52900.65770.38470.13700.050.11620.65327.890.0050
Exp(LogOR13)   1.46920.20130.051.12331.9217  
LogOR230.34390.28500.4081-0.64570.13970.05-0.9196-0.371921.36<.0001
Exp(LogOR23)   0.52430.07330.050.39870.6894