1 / 16

Using margins to test for group differences in generalized l inear m ixed m odels

Using margins to test for group differences in generalized l inear m ixed m odels. Sarah Mustillo Purdue University. Stata Conference Chicago 2011. Introduction Examples Application Conclusion. Problem. The problem.

doris
Download Presentation

Using margins to test for group differences in generalized l inear m ixed m odels

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Using margins to test for group differences in generalized linear mixed models Sarah Mustillo Purdue University Stata Conference Chicago 2011

  2. Introduction Examples Application Conclusion Problem 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). Using Margins to test for group differences in GLMMs

  3. Introduction Examples Application Conclusion Problem 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. Using Margins to test for group differences in GLMMs

  4. Introduction Examples Application Conclusion Problem 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. Using Margins to test for group differences in GLMMs

  5. Introduction Examples Application Conclusion Problem 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. Using Margins to test for group differences in GLMMs

  6. Introduction Examples Application Conclusion Motivating example 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. Using Margins to test for group differences in GLMMs

  7. Introduction Examples Application Conclusion Empirical example Results from –xtmepoisson- Using Margins to test for group differences in GLMMs

  8. Introduction Examples Application Conclusion Fake example Fake example - Graphs of generated count variables with gender differences in slope. Using Margins to test for group differences in GLMMs

  9. Introduction Examples Application Conclusion Fake example Fake example - Graphs of generated count variables with gender differences in slope. 1.22 1.25 1.32 1.40 1.24 1.17 Ratio Female/Male = 1.32/1.40=.93 Ratio Female/Male = 1.25/1.24=1.01 Ratio Female/Male = 1.22/1.17=1.03 Using Margins to test for group differences in GLMMs

  10. Introduction Examples Application Conclusion Fake example Table 2. Mixed Poisson Regression Models Estimated for Generated CountVariables in EPESE Data (n=16,648). Using Margins to test for group differences in GLMMs

  11. Introduction Examples Application Conclusion Margins 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? Using Margins to test for group differences in GLMMs

  12. Introduction Examples Application Conclusion Margins 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? • xtmepoissonyvari.female##c.time || person:time, cov(unstr) varmle • margins , dydx(time) over(female) predict(fixedonly) post • lincom _b[0.female] - _b[1.female] Using Margins to test for group differences in GLMMs

  13. Introduction Examples Application Conclusion Margins Table 3. Using –margins- following –xtmepoisson- to test for group differences in slope in the fake examples Using Margins to test for group differences in GLMMs

  14. Introduction Examples Application Conclusion Empirical example Table 4. Using –margins- following –xtmepoisson- to test for group differences in slope in the original example Using Margins to test for group differences in GLMMs

  15. Introduction Examples Application Conclusion Empirical example Table 5. Using –margins- following –xtmepoisson- to test for group differences in slope in the original example with additional covariates and an additional interaction Using Margins to test for group differences in GLMMs

  16. 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. Using Margins to test for group differences in GLMMs

More Related