8.7. Mixed Logit Models

There is another approach to dichotomous clustered data that is likely to become increasingly attractive in the next few years. In my judgment, however, it’s not quite ready for prime time. In this approach, clustering is treated as a random effect in a mixed model—so named because it includes both fixed and random effects. Mixed models are quite similar to the GEE method discussed earlier but have two potential advantages. First, much more complex models are possible, with multiple levels of clustering, overlapping clusters, and random coefficients. Second, estimation of mixed models can correct for heterogeneity shrinkage discussed in Section 3.11. In other words, mixed models are subject specific rather than population averaged like the models estimated by GEE.

The problem with mixed logit models is that they are not easy to estimate. While the MIXED procedure in SAS does an excellent job of estimating mixed models when the dependent variable is continuous and normally distributed, it does not handle dichotomous data. There are several commercial multi-level modeling packages that will estimate mixed logit models, but all involve approximations that may produce substantial biases with certain data configurations (McCulloch 1997, Rodriguez and Goldman 1995).

There is also a SAS macro called GLIMMIX (which can be downloaded at www.sas.com) that serves as a front-end to the MIXED procedure, enabling it to estimate models for dependent variables with binomial, Poisson, and other distributions. Like other mixed logit programs, GLIMMIX has been criticized for the accuracy of its approximations. It’s also quite slow and much worse than built-in procedures at handling errors in data, syntax, or model specification—characteristics it shares with many other macro-based procedures. Nevertheless, because of the potential of this methodology, I’ll present two examples here. (Incidentally, earlier versions of the GLIMMIX macro do not work with Release 6.12 of SAS. You should download the version specifically labeled for the release of SAS that you are using.)

In its simplest form, the mixed logit model looks just like the fixed-effects model of equation (8.2):


The difference is that now, instead of treating αi as representing a set of fixed constants, we assume that each αi is a random variable with a specified probability distribution. For the models estimated with GLIMMIX, the αi’s are assumed to be independent of the xit and to have a normal distribution with a mean of 0. In the simpler models, they are also assumed to be independent of each other and have a constant variance of σ2.

Let’s estimate this model for the PTSD data in Section 8.2. After reading in the GLIMMIX macro, the SAS code for specifying the model is:

DATA ptsd;
  SET my.ptsd;
  n=1;
RUN;

%GLIMMIX(DATA=ptsd, STMTS=%STR(

  CLASS subjid time;
  MODEL ptsd/n = control problems sevent cohes time /
     SOLUTION;
  RANDOM subjid;

))

The DATA step defines a new variable N that is always equal to 1. This is necessary because GLIMMIX—like older SAS releases with PROC GENMOD—presumes that the logit model is estimated from grouped data. The MODEL statement that follows uses the grouped-data syntax PTSD/N, where N is the number of observations in each group—in this case, 1.

GLIMMIX works by repeated calls to the MIXED procedure, and the statements specifying the model are identical to those used in the MIXED procedure for an analogous linear model. These statements are listed as arguments to the %STR function. The SOLUTION option in the MODEL statement is necessary to get coefficient estimates—otherwise only F-statistics are reported. The RANDOM statement specifies the random effects, in this case, one random variable for each person in the data set. Because the default in GLIMMIX is a logit model with a binomial error distribution, no further options are necessary. The results are shown in Output 8.17.

The first thing we find in the output is an estimate of the common variance of the random effects, 2.613. If this were 0, we’d be back to an ordinary logit model, which is displayed in Output 8.2. To test the null hypothesis that the variance is 0, we can compare deviances for the models with and without this parameter. In Output 8.17, the deviance is 550.01 as compared with 966.85 in Output 8.2. The difference between the two deviances is 416.84. This can be regarded as a chi-square of 416.84 (with 1 d.f. for the single parameter), which is significant by anyone’s standards.

Output 8.17. GLIMMIX Output for PTSD Data
                 Covariance Parameter Estimates

                     Cov
                     Parm         Estimate

                    SUBJID      2.61300590

                   GLIMMIX Model Statistics

           Description                       Value

           Deviance                       550.0122
           Scaled Deviance                996.5090
           Pearson Chi-Square             417.7434
           Scaled Pearson Chi-Square      756.8652
           Extra-Dispersion Scale           0.5519

                          Parameter Estimates

Effect       TIME     Estimate     Std Error     DF         t    Pr > |t|

INTERCEPT               2.4074        0.9676    315      2.49      0.0134
CONTROL                -1.2604        0.2362    626     -5.34      0.0001
PROBLEMS                0.3088        0.0570    626      5.42      0.0001
SEVENT                  0.3339        0.0862    626      3.87      0.0001
COHES                  -0.2353        0.0566    626     -4.15      0.0001
TIME          1         0.6188        0.1915    626      3.23      0.0013
TIME          2         0.3756        0.1797    626      2.09      0.0369
TIME          3         0.0000         .          .       .         .

                         Tests of Fixed Effects

              Source     NDF    DDF    Type III F    Pr > F

              CONTROL     1     626         28.48    0.0001
              PROBLEMS    1     626         29.35    0.0001
              SEVENT      1     626         15.00    0.0001
              COHES       1     626         17.26    0.0001
              TIME        2     626          5.26    0.0054

The coefficients in Output 8.17 are all somewhat larger than those produced by GEE estimation in Output 8.3, exemplifying the fact that the mixed model approach corrects for heterogeneity shrinkage. The F-statistics in the lower part of the table can be directly compared with the chi-squares in Table 8.2 because the denominator degrees of freedom is so large. (The F-distribution with 1 numerator d.f. converges to a chi-square distribution as the denominator d.f. gets large.) All the mixed model chi-squares are larger than the GEE chi-squares for the EXCH option, which is the most comparable model.

Now let’s try GLIMMIX on the postdoctoral data. The SAS code looks pretty much the same:

DATA postdoc;
  SET my.postdoc;
  n=1;
RUN;

%GLIMMIX(DATA=postdoc,STMTS=%STR(

  CLASS docid;
  MODEL pdoc/n=age mar doc ag und arts cits / SOLUTION;
  RANDOM docid;

))

The results in Output 8.18 are quite similar to the GEE estimates in Output 8.7. Although all the coefficients in 8.18 are larger than those in 8.7, the differences are trivial. The estimated variance of the random term (.455) is much lower than the 2.61 we got for the PTSD data. Again, we can test whether the variance is significantly different from 0 by taking the difference between the deviance for this model (618.2) and the deviance for the conventional logit model (688.6). The resulting chi-square of 70.39 (1 d.f.) is highly significant but not nearly as large as for the PTSD data. This reflects the fact that the within-cluster correlation is not nearly as strong here. The F-statistics are compared with the chi-square statistics for other methods in the last column of Table 8.3. They tend to be a bit higher than the chi-squares for the other corrected methods but still lower than those from conventional logit estimation.

Output 8.18. GLIMMIX Results for Postdoctoral Data
                     Cov
                    Parm         Estimate

                    DOCID      0.45524856

                   GLIMMIX Model Statistics

           Description                       Value

           Deviance                       618.2550
           Scaled Deviance                664.8388
           Pearson Chi-Square             480.9393
           Scaled Pearson Chi-Square      517.1767
           Extra-Dispersion Scale           0.9299
                          Parameter Estimates

    Effect        Estimate     Std Error     DF      t    Pr > |t|

    INTERCEPT       2.5706        0.9504    104   2.70      0.0080
    AGE            -0.1055        0.0259    442  -4.08      0.0001
    MAR            -0.5640        0.2704    442  -2.09      0.0375
    DOC             0.0028        0.0012    442   2.23      0.0261
    AG             -0.9687        0.2506    442  -3.86      0.0001
    UND             0.1225        0.0609    442   2.01      0.0448
    ARTS           -0.0746        0.0826    442  -0.90      0.3668
    CITS           -0.0043        0.0178    442  -0.24      0.8071

                        Tests of Fixed Effects

              Source   NDF    DDF    Type III F   Pr > F

              AGE        1    442          16.63   0.0001
              MAR        1    442           4.35   0.0375
              DOC        1    442           4.99   0.0261
              AG         1    442          14.94   0.0001
              UND        1    442           4.05   0.0448
              ARTS       1    442           0.82   0.3668
              CITS       1    442           0.06   0.8071

Now let’s try a random coefficients model—something that can’t be done with any of the other methods we’ve looked at. More specifically, let’s suppose that the effect of getting a degree from an agricultural school varies randomly across different universities. If β is the coefficient for AG, our new model says that βj = τ0 + τj where j refers to 108 different universities and each τj is a normally distributed random variable with a mean of 0 and a variance of ω2. This is in addition to the random “main effect” of university that was in the previous model. In SAS code, the model is

%GLIMMIX(DATA=postdoc,STMTS=%STR(

  CLASS docid;
  MODEL pdoc/n=age mar doc ag und arts cits/SOLUTION;
  RANDOM docid docid*ag;

))

The results in Output 8.19 suggest that there may indeed be differences across universities in the effect of agricultural school on postdoctoral training. The AG*DOCID interaction is almost as large as the main effect of DOCID. To test its significance, we can compare the deviance for this model with that of the previous one. The resulting chi-square is about 7.0 with 1 d.f., which is significant at beyond the .01 level. I didn’t bother reporting the coefficients and F-statistics because they’re not much different from those in Output 8.18.

Output 8.19. Results for a Random Coefficients Model
    Covariance Parameter Estimates

        Cov Parm        Estimate

        DOCID         0.45938901
        AG*DOCID      0.20137669
        GLIMMIX Model Statistics

Description                       Value

Deviance                       612.4306
Scaled Deviance                664.3210
Pearson Chi-Square             474.4997
Scaled Pearson Chi-Square      514.7034
Extra-Dispersion Scale           0.9219

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.241.82