Using PROC MIANALYZE to combine estimates from a multinomial logistic model


Ordinal Response - Proportional Odds Model

The data below represent an experiment in which researchers tested four cheese additives and obtained 52 response ratings for each additive. Each response was measured on a scale of nine categories ranging from strong dislike (1) to excellent taste (9). There were missing values in the response for six observations so PROC MI is used to impute those missing values. Because the response is ordinal, the monotone logistic imputation method is used.

      data Cheese;
        input Additive y @@;
        datalines;
      1 3 1 4 1 4 1 4 1 4 1 4 1 4 1 4 1 5 
      1 5 1 5 1 5 1 5 1 5 1 5 1 5 1 6 1 6 
      1 6 1 6 1 6 1 6 1 6 1 6 1 7 1 7 1 7 
      1 . 1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 7 
      1 7 1 7 1 7 1 7 1 7 1 7 1 7 1 8 1 8 
      1 8 1 8 1 8 1 8 1 8 1 8 1 9 2 1 2 1 
      2 1 2 1 2 1 2 1 2 2 2 2 2 2 2 2 2 2 
      2 2 2 2 2 2 2 2 2 3 2 3 2 3 2 3 2 3 
      2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 4 2 4
      2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 2 4 
      2 5 2 5 2 5 2 5 2 5 2 5 2 5 2 6 2 6 
      2 . 2 6 2 6 2 6 2 7 3 1 3 2 3 3 3 3 
      3 3 3 3 3 3 3 3 3 4 3 4 3 4 3 4 3 4 
      3 4 3 4 3 4 3 5 3 5 3 5 3 5 3 5 3 5 
      3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 
      3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 5 3 . 
      3 6 3 6 3 6 3 6 3 6 3 6 3 7 3 7 3 7 
      3 7 3 7 3 8 4 4 4 5 4 5 4 5 4 6 4 6 
      4 6 4 6 4 6 4 6 4 6 4 7 4 7 4 7 4 7 
      4 7 4 7 4 7 4 7 4 7 4 7 4 7 4 7 4 7 
      4 7 4 8 4 8 4 8 4 8 4 8 4 8 4 8 4 . 
      4 8 4 8 4 8 4 8 4 8 4 8 4 8 4 8 4 . 
      4 9 4 9 4 9 4 9 4 9 4 9 4 9 4 9 4 . 
      4 9 
      ;
      
      proc mi data=Cheese out=cheese_mi seed=1;
        class additive y;
        var additive y;
        monotone logistic (y=additive);
        run;

The following statements fit a proportional odds model for each imputed data set. The OUTEST= and COVOUT options save the parameter estimates and the estimated covariance matrix of the estimates to a data set.

      proc logistic data=cheese_mi outest=ordinal_parms covout;
        by _imputation_;
        class additive;
        model y=additive;
        run;

It is necessary to understand the naming convention that PROC LOGISTIC uses in naming the variables containing the parameter estimates in the OUTEST= data set so they can be specified in the MODELEFFECTS statement in PROC MIANALYZE. The intercept variables are named Intercept_xxx, where xxx is the value (formatted if a format is applied) of the corresponding response category.

For continuous explanatory variables, the variable names containing the parameters are the same as the corresponding model variables. For CLASS variables, the variable names are obtained by concatenating the corresponding CLASS variable name with the CLASS category. For interaction and nested effects, the parameter names are created by concatenating the names of each effect. See "Input and Output Data Sets: Parameter Names in the OUTEST= Data Set" in the Details section of the PROC LOGISTIC documentation for more details.

The names of the variables containing the parameter estimates are easily seen using PROC PRINT or PROC CONTENTS. The following statements display the parameter estimates from the first imputed data set. Note the names of variables containing the parameter estimates.

      proc print data=ordinal_parms noobs;
        where _imputation_=1 and _TYPE_="PARMS";
        var int: add:;
        title 'Parameter Estimates for the First Imputation';
        run;
Parameter Estimates for the First Imputation

Intercept_1Intercept_2Intercept_3Intercept_4Intercept_5Intercept_6Intercept_7Intercept_8Additive1Additive2Additive3
-4.61011-3.55410-2.45286-1.382900.0435770.977852.553904.15586-0.916142.499800.83682

PROC MIANALYZE can now be used to combine the results from the imputed data sets. The parameter variables are individually listed in the MODELEFFECTS statement. Note that variable lists such as intercept_1-intercept_8 or int: cannot be used. The EDF= option is also specified because the calculated degrees of freedom far exceed the complete data degrees of freedom. In this case it is set to 197 which is the number of observations (208) minus the number of parameters (11).

      proc mianalyze data=ordinal_parms edf=197;
        modeleffects intercept_1 intercept_2 intercept_3 intercept_4 
                     intercept_5 intercept_6 intercept_7 intercept_8 
                     additive1 additive2 additive3;
        run;
Parameter Estimates
ParameterEstimateStd Error95% Confidence LimitsDFMinimumMaximumTheta0t for H0:
Parameter=Theta0
Pr > |t|
intercept_1-4.6192010.429829-5.46674-3.77166201.31-4.642194-4.5678570-10.75<.0001
intercept_2-3.5466590.311251-4.16049-2.93282195.81-3.584784-3.5004690-11.39<.0001
intercept_3-2.4470920.244062-2.92845-1.96573193.59-2.480908-2.4121490-10.03<.0001
intercept_4-1.3493800.202164-1.74808-0.95068195.75-1.382898-1.3192150-6.67<.0001
intercept_50.0574920.183550-0.304650.41963183.690.0100790.09421400.310.7545
intercept_60.9728290.1910860.595961.34970194.530.9380731.00789105.09<.0001
intercept_72.4679570.2467181.980762.95516161.962.4191852.553901010.00<.0001
intercept_84.1077720.3657953.386404.82914197.44.0562464.155857011.23<.0001
additive1-0.9126140.231845-1.36985-0.45538195.66-0.931951-0.8617890-3.940.0001
additive22.5157870.2755721.972273.05931193.012.4548942.54247009.13<.0001
additive30.8128440.2289250.361431.26426200.420.7892170.83681703.550.0005

Nominal Response - Generalized Logit Model

For the purpose of illustration, missing values are introduced into the variable Program in the school instruction style data set that demonstrates how to use PROC LOGISTIC to fit a generalized logit model.

      data school;
        length Program $ 9;
        input School Program $ Style $ NumStudent Count @@; 
        datalines; 
      1 regular   self 21 10  1 regular   team 22 17  1 regular   class 16 26
      1 afternoon self 23  5  1 afternoon team 26 12  1 afternoon class 21 50 
      2 .         self 22 21  2 regular   team 31 17  2 regular   class 32 26
      2 .         .    18 16  2 afternoon team 28 12  2 afternoon class 27 36 
      3 regular   self 14 15  3 regular   team 32 15  3 regular   class 31 16
      3 afternoon self 19 12  3 afternoon team 30 12  3 .         class 33 20 
      ;

PROC MI is used to impute the missing values. The DISCRIM method is used for Style since it is nominal with three levels and the LOGISTIC method is used for Program since it has two levels.

      proc mi data=school out=school_imp;
        freq count;
        class school style program;
        var NumStudent school style program;
        monotone discrim (style=NumStudent);
        monotone logistic (program=school style);
        title 'Proc MI results for monotone Logistic model';
        run;

These statements fit a generalized logit model to each of the imputed data sets using PROC LOGISTIC. The OUTEST= and COVOUT options create a data set containing the parameter estimates and the estimated covariance matrix of the estimates.

      proc logistic data=school_imp outest=imp_parms covout;
        by _imputation_;
        freq Count; 
        class School Program(ref=first);
        model Style(order=data)=School Program NumStudent / link=glogit;
        run;

The parameter variables needed for the MODELEFFECTS statement in PROC MIANALYZE are named as described above for the ordinal model. However, for the generalized logit model, names of parameters corresponding to each nonreference category contain _xxx as the suffix, where xxx is the value (formatted if a format is applied) of the corresponding nonreference category. See "Input and Output Data Sets: Parameter Names in the OUTEST= Data Set" in the Details section of the PROC LOGISTIC documentation for more details and an example. As before, the names can be displayed using PROC PRINT.

      proc print data=imp_parms noobs;
        where _imputation_=1 and _TYPE_="PARMS";
        var int: sch: pro: num:;
        title 'Parameter Estimates for the First Imputation';
        run;
Parameter Estimates for the First Imputation

Intercept_selfIntercept_teamSchool1_selfSchool1_teamSchool2_selfSchool2_teamProgramregular_selfProgramregular_teamNumStudent_selfNumStudent_team
4.82870-10.7580-1.308661.81873-0.036896-0.84613-0.27715-0.21415-0.262430.36837

The following statements use PROC MIANALYZE to combine the results from the imputed data sets. As discussed in the previous example, the individual parameters are specified in the MODELEFFECTS statement and the EDF= option is also specified and set to 328 which is the number of observations (338) minus the number of parameters (10).

      proc mianalyze data=imp_parms edf=328;
        modeleffects Intercept_self      Intercept_team 
                     School1_self        School1_team 
                     School2_self        School2_team 
                     Programregular_self Programregular_team 
                     NumStudent_self     NumStudent_team ;
        run;
Parameter Estimates
ParameterEstimateStd Error95% Confidence LimitsDFMinimumMaximumTheta0t for H0:
Parameter=Theta0
Pr > |t|
Intercept_self7.9158592.2615042.605513.226207.25084.8286959.08672703.500.0094
Intercept_team-7.6134005.067041-20.85815.631264.7383-10.757964-0.0908660-1.500.1964
School1_self-2.2022070.739524-3.9822-0.422226.4403-2.654357-1.3086590-2.980.0227
School1_team1.2015551.126320-1.71164.114744.8999-0.4851011.81872901.070.3358
School2_self0.7494340.725993-1.08152.580325.3417-0.0368961.23229901.030.3464
School2_team-0.5457670.559290-1.95470.863155.363-0.8461320.2767310-0.980.3711
Programregular_self0.0249190.771680-2.07302.122884.2267-1.0174470.56910200.030.9757
Programregular_team0.1089560.338419-0.72360.941475.8709-0.2141470.33684500.320.7586
NumStudent_self-0.3885060.094675-0.6069-0.170087.9787-0.432170-0.2624280-4.100.0034
NumStudent_team0.2536990.183384-0.22600.733424.7266-0.0184780.36837001.380.2283