# Using margins to test for group differences in generalized

Document Sample

```					Using margins to test for group differences in
generalized linear mixed models

Sarah Mustillo
Purdue University

Sarah A. Mustillo, Ph.D   Stata Conference Chicago 2011
Introduction   Problem
Examples
Application
Conclusion

The problem

• Linear mixed models (LMM) are a standard model for estimating trajectories of
change over time in longitudinal data.

• Theory, specification, estimation, and post-estimation evaluation techniques for
LMMs are well-developed.

• Less so for generalized linear mixed models (GLMM).

Sarah A. Mustillo, Ph.D        Using Margins to test for group differences in GLMMs
Introduction   Problem
Examples
Application
Conclusion

Testing for group differences

• In LMMs, researchers tend to include a group by time interaction term to test for
group differences.

• Others have suggested that this same procedure can be used in nonlinear
models. For example, Rabe-Hesketh and Skrondal (2005) note that the
coefficient of the product term can be interpreted as indicating group differences
in the rate of change over time in logistic models (pp.115-118) and ordinal
models (155-161).

• But, interaction terms in nonlinear models are different than interaction terms in
linear models.

Sarah A. Mustillo, Ph.D        Using Margins to test for group differences in GLMMs
Introduction   Problem
Examples
Application
Conclusion

Interpreting interactions in nonlinear models

• For example, Ai and Norton (2004) argue that:
• The coefficient of the interaction term in a linear model is the same as the
first derivative or marginal effect and thus a group by time interaction term in
a linear model can be interpreted as group differences in the effect of time
on the DV.
• In nonlinear models, the first derivative of the interaction term is not the
interaction effect. For that, we need the cross-partial derivative of E(y) with
respect to group and time.

• -inteff- is one way to interpret interactions in logit and probit models, but it’s not a
panacea for several reasons.
• Only available for logit and probit.
• Not available for longitudinal models.
• Difficult to interpret and generalize.

Sarah A. Mustillo, Ph.D        Using Margins to test for group differences in GLMMs
Introduction   Problem
Examples
Application
Conclusion

Longitudinal models

• In the longitudinal, mixed model context, the interaction of a grouping variable
and a time variable is a test for group differences in slope, but it’s a test on a
ratio scale, which isn’t always what we want (or ever, in my case).

• The difference in the rate of change (rather than the ratio of change) can be
measured by taking the derivative or partial derivative of the conditional
expectation of Y with respect to time by group.

• When the ratio of change and the rate of change are close, both yield similar
results. When they aren’t the same, they provide different results and answer
different questions.

Sarah A. Mustillo, Ph.D        Using Margins to test for group differences in GLMMs
Introduction   Motivating example
Examples
Application
Conclusion

Real example

• Using the Established Populations for Epidemiological Studies of the Elderly
(EPESE) data, we were exploring the effects of baseline cognitive status on
change in physical functioning over time. Physical functioning was measured as
a count of instrumental tasks the subject could not perform. We used
–xtmepoisson- with a cognitive impairment X time interaction term to test for the
group difference in slope.

• Based on previous work, we expected baseline cognitive impairment to be
associated with greater yearly increases in disability over time. Indeed,
descriptive statistics showed an increase of .06 per year in the cognitively intact
and .13 in the cognitively impaired.
(2) (2)                                                    (2) (2)
ln( | ζ ,ζ )  β  β Time  β Impairment  β Impariment *Time  ζ     ζ * Time
it 1    2    0   1    it  2          i   3          i     it   1     2       it
i   i                                                      i     i

Sarah A. Mustillo, Ph.D         Using Margins to test for group differences in GLMMs
Introduction      Empirical example
Examples
Application
Conclusion

Results from –xtmepoisson-
Table 1. Estimated Mixed Poisson Model of Number of IADL's Regressed on Cognitive Impairment by Time,
EPESE Data.

Fixed parameters
B               SE          IRR
Cognitive impairment                                  2.817***         (0.161)       16.73
Time                                                  0.541***         (0.060)       1.72
Cog impairment X Time                                 -0.188***        (0.046)       0.83
Intercept                                             -4.555***        (0.144)

Random components

Slope variance                                          0.102          (0.0187)
Intercept variance                                      7.562           (0.679)
Covariance                                             -0.487           (0.115)

Summary Statistics

N                                                   15016
Chi square                                         434.050
Log likelihood                                    -8346.699

Note: Standard errors in parentheses
* p< .05 **p<.01 *** p<.001

Sarah A. Mustillo, Ph.D              Using Margins to test for group differences in GLMMs
Introduction              Fake example
Examples
Application
Conclusion

Fake example - Graphs of generated count variables with gender differences in slope.
Graph of gender interaction in simulated Poisson variable with a mean of 4.                         Graph of gender interaction in simulated Poisson variable with mean = 5.                          Graph of gender interaction in simulated Poisson variable with a mean of 6.

10
9
8

Simulated DV, mean=5

Simulated DV, mean=6
7

8
6

6
5
4

4
3
2

2
1
0

0                     1                      2                              3                   0                      1                       2                              3                      0                    1                       2                     3
time                                                                                             Time                                                                                               time

Male            Female                                                                          Males             Females                                                                           Male             Female

Histogram of simulated Poisson variable with a mean of 4.                                        Histogram of simulated Poisson variable with a mean of 5.                                       Histogram of simulated Poisson variable with a mean of 6.
.6

.4

.4
.3

.3
.4

Density

Density
.2

.2
.2

.1

.1
0

0

0
0                    5                      10                              15                  0               5                10                15                     20                     0               5                10                15             20
Simulated Poisson variable, mean = 4                                                             Simulated Poisson variable, mean = 5                                                             Simulated Poisson variable, mean = 6

Sarah A. Mustillo, Ph.D                                        Using Margins to test for group differences in GLMMs
Introduction              Fake example
Examples
Application
Conclusion

Fake example - Graphs of generated count variables with gender differences in slope.
Graph of gender interaction in simulated Poisson variable with a mean of 4.              Graph of gender interaction in simulated Poisson variable with mean = 5.                  Graph of gender interaction in simulated Poisson variable with a mean of 6.

10
9
8

Simulated DV, mean=5

Simulated DV, mean=6
7
6

8
1.22
1.32                                                                                   1.25
4

6
5
1.40                                                                                            1.24                                                                                    1.17
2

4
3
0

2
1
0                    1                      2                               3         0                      1                      2                                 3           0                     1                      2                      3
time                                                                                    Time                                                                                       time

Male            Female                                                                 Males             Females                                                                   Male            Female

Ratio Female/Male =                                                                     Ratio Female/Male =                                                                    Ratio Female/Male =
1.32/1.40=.93                                                                           1.25/1.24=1.01                                                                         1.22/1.17=1.03

Sarah A. Mustillo, Ph.D                               Using Margins to test for group differences in GLMMs
Introduction    Fake example
Examples
Application
Conclusion

Table 2. Mixed Poisson Regression Models Estimated for Generated Count Variables in EPESE Data (n=16,648).

Model 1_______                     Model 2______                       Model 3_____
Mean Outcome=                              4                                 5                                6

B            (S.E)     IRR         b            (S.E)       IRR          B         (S.E)     IRR
Time                     .340***       (0.008)   1.406***   .222***       (0.006)     1.250***   .165***     (0.059)   1.180***

Female                   1.037***      (0.020)   2.822***   .671***       (0.016)     1.957***   .498***     (0.013)   1.646***

Female*Time              -0.065***     (0.009)   0.937***   .005          (0.007)     1.006      .029***     (0.006)   1.030***

Intercept                0.080***      (0.019)              0.741***      (0.014)                1.397***    (0.011)

Chi square               13824.89                           11435.03                             9775.27

Log likelihood           28298.13                           31527.75                             34031.66

Note: Standard errors in parentheses
* p< .05 **p<.01 *** p<.001

Sarah A. Mustillo, Ph.D         Using Margins to test for group differences in GLMMs
Introduction   Margins
Examples
Application
Conclusion

Using –margins- to assess the group difference

• The interaction term does not test what we want to test here.

• We want to calculate the partial derivative of E(Y) with respect to time by group
and then test for a significant difference using a Wald test.

• Hmmm…does Stata have a command that can do that?

Sarah A. Mustillo, Ph.D         Using Margins to test for group differences in GLMMs
Introduction   Margins
Examples
Application
Conclusion

Using –margins- to assess the group difference

• The interaction term does not test what we want to test here.

• We want to calculate the partial derivative of E(Y) with respect to time by group
and then test for a significant difference using a Wald test.

• Hmmm…does Stata have a command that can do that?

• xtmepoisson yvar i.female##c.time || person:time,
cov(unstr) var mle

• margins , dydx(time) over(female) predict(fixedonly) post

• lincom _b[0.female] - _b[1.female]

Sarah A. Mustillo, Ph.D         Using Margins to test for group differences in GLMMs
Introduction   Margins
Examples
Application
Conclusion

Table 3. Using –margins- following –xtmepoisson- to test for group differences in slope in the fake examples

Model 1_______                       Model 2______                          Model 3_____
Mean Outcome=                     4                                    5                                  6

Fem ratio/                      0.93                                 1.01                                 1.03
Male ratio

dy/dt

Male                      0.693*** (0.018)                     0.659***(0.021)                      0.687***(0.027)

Female                    1.359***(0.021)                      1.325*** (0.022)                     1.329*** (0.025)

Difference                0.667***(0.028)                      0.665***(0.031)                      0.642***(0.037)

Sarah A. Mustillo, Ph.D         Using Margins to test for group differences in GLMMs
Introduction      Empirical example
Examples
Application
Conclusion

Table 4. Using –margins- following –xtmepoisson- to test for group differences in slope in the original example

Disability

b                         SE             IRR
1.716***

Time                                            .541***                    (0.102)
16.727***

Cognitive impairment                            2.817***                   (2.686)
0.830***

Cog impairment X Time                           -0.187***                  (0.038)

Intercept                                       -4.555***

dy/dt

No cog impairment                   0.015***                   (0.002)

Cog impairment                      0.108***                   (0.018)

Difference                          0.093***                   (0.017)

Note: Random coefficients omitted, * p<0.05, ** p<0.01, *** p<0.001

Sarah A. Mustillo, Ph.D              Using Margins to test for group differences in GLMMs
Introduction   Empirical example
Examples
Application
Conclusion

Table 5. Using –margins- following –xtmepoisson- to test for group differences in slope
Disability
B                      SE                       IRR
Time                                                        .564***                 (0.082)               1.758***
Cognitive impairment                                        2.130***                (1.299)               8.413***
Cog impairment X Time                                       -0.186***               (0.035)               0.830***
Age                                                         0.114***                (0.008)               1.121***
Female                                                       -0.032                 (0.113)                0.969
Black                                                        0.225*                 (0.131)                1.253*
Income                                                      -0.029***               (0.006)               0.972***
Married                                                      0.005                  (0.152)                1.005
Married X Time                                               -0.025                 (0.040)                0.976
Intercept                                                  -12.701***

dy/dt
No cog impairment                                          0.022***                (0.003)
Cog impairment                                             0.163***                (0.024)
Difference                                                 0.141***                (0.023)
Married                                                   0.019***                 (0.003)
Unmarried                                                 0.052***                 (0.006)
Difference                                                0.033***                 (0.005)

Sarah A. Mustillo, Ph.D         Using Margins to test for group differences in GLMMs
Introduction
Examples
Application
Conclusion

Summary

• In the generalized linear mixed model, the group by time interaction term is
measuring differences in the ratio of change, e.g., change on a multiplicative
scale.

• This isn’t wrong – it just wasn’t what we wanted.

• -margins- provides an easy way to test group difference in rate of change over
time on an additive scale by allowing us to calculate the partial derivative of the
response with respect to time separately by group and then run a significance
test between the two.

Sarah A. Mustillo, Ph.D        Using Margins to test for group differences in GLMMs

```
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
 views: 0 posted: 5/9/2013 language: pages: 16