You are on page 1of 6

The Stata Journal

Editor H. Joseph Newton Department of Statistics Texas A&M University College Station, Texas 77843 979-845-8817; fax 979-845-6077 jnewton@stata-journal.com Associate Editors Christopher F. Baum Boston College Nathaniel Beck New York University Rino Bellocco Karolinska Institutet, Sweden, and University of Milano-Bicocca, Italy Maarten L. Buis T ubingen University, Germany A. Colin Cameron University of CaliforniaDavis Mario A. Cleves Univ. of Arkansas for Medical Sciences William D. Dupont Vanderbilt University David Epstein Columbia University Allan Gregory Queens University James Hardin University of South Carolina Ben Jann ETH Z urich, Switzerland Stephen Jenkins University of Essex Ulrich Kohler WZB, Berlin Frauke Kreuter University of MarylandCollege Park Stata Press Editorial Manager Stata Press Copy Editors Peter A. Lachenbruch Oregon State University Jens Lauritsen Odense University Hospital Stanley Lemeshow Ohio State University J. Scott Long Indiana University Roger Newson Imperial College, London Austin Nichols Urban Institute, Washington DC Marcello Pagano Harvard School of Public Health Sophia Rabe-Hesketh University of CaliforniaBerkeley J. Patrick Royston MRC Clinical Trials Unit, London Philip Ryan University of Adelaide Mark E. Schaer Heriot-Watt University, Edinburgh Jeroen Weesie Utrecht University Nicholas J. G. Winter University of Virginia Jerey Wooldridge Michigan State University Lisa Gilmore Deirdre Patterson and Erin Roberson Editor Nicholas J. Cox Department of Geography Durham University South Road Durham City DH1 3LE UK n.j.cox@stata-journal.com

The Stata Journal publishes reviewed papers together with shorter notes or comments, regular columns, book reviews, and other material of interest to Stata users. Examples of the types of papers include 1) expository papers that link the use of Stata commands or programs to associated principles, such as those that will serve as tutorials for users rst encountering a new eld of statistics or a major new technique; 2) papers that go beyond the Stata manual in explaining key features or uses of Stata that are of interest to intermediate or advanced users of Stata; 3) papers that discuss new commands or Stata programs of interest either to a wide spectrum of users (e.g., in data management or graphics) or to some large segment of Stata users (e.g., in survey statistics, survival analysis, panel analysis, or limited dependent variable modeling); 4) papers analyzing the statistical properties of new or existing estimators and tests in Stata; 5) papers that could be of interest or usefulness to researchers, especially in elds that are of practical importance but are not often included in texts or other journals, such as the use of Stata in managing datasets, especially large datasets, with advice from hard-won experience; and 6) papers of interest to those who teach, including Stata with topics such as extended examples of techniques and interpretation of results, simulations of statistical concepts, and overviews of subject areas. For more information on the Stata Journal, including information for authors, see the web page http://www.stata-journal.com The Stata Journal is indexed and abstracted in the following: CompuMath Citation Index R Current Contents/Social and Behavioral Sciences R RePEc: Research Papers in Economics Science Citation Index Expanded (also known as SciSearch R ) Social Sciences Citation Index R

Copyright Statement: The Stata Journal and the contents of the supporting les (programs, datasets, and help les) are copyright c by StataCorp LP. The contents of the supporting les (programs, datasets, and help les) may be copied or reproduced by any means whatsoever, in whole or in part, as long as any copy or reproduction includes attribution to both (1) the author and (2) the Stata Journal. The articles appearing in the Stata Journal may be copied or reproduced as printed copies, in whole or in part, as long as any copy or reproduction includes attribution to both (1) the author and (2) the Stata Journal. Written permission must be obtained from StataCorp if you wish to make electronic copies of the insertions. This precludes placing electronic copies of the Stata Journal, in whole or in part, on publicly accessible web sites, leservers, or other locations where the copy may be accessed by anyone other than the subscriber. Users of any of the software, ideas, data, or other materials published in the Stata Journal or the supporting les understand that such use is made without warranty of any kind, by either the Stata Journal, the author, or StataCorp. In particular, there is no warranty of tness of purpose or merchantability, nor for special, incidental, or consequential damages such as loss of prots. The purpose of the Stata Journal is to promote free communication among Stata users. The Stata Journal (ISSN 1536-867X) is a publication of Stata Press. Stata, Mata, NetCourse, and Stata Press are registered trademarks of StataCorp LP.

The Stata Journal (2010) 10, Number 2, pp. 305308

Stata tip 87: Interpretation of interactions in nonlinear models


Maarten L. Buis Department of Sociology T ubingen University T ubingen, Germany maarten.buis@uni-tuebingen.de When tting a nonlinear model such as logit (see [R] logit) or poisson (see [R] poisson), we often have two options when it comes to interpreting the regression coecients: compute some form of marginal eect or exponentiate the coecients, which will give us an odds ratio or incidence-rate ratio. The marginal eect is an approximation of how much the dependent variable is expected to increase or decrease for a unit change in an explanatory variable; that is, the eect is presented on an additive scale. The exponentiated coecients give the ratio by which the dependent variable changes for a unit change in an explanatory variable; that is, the eect is presented on a multiplicative scale. An extensive overview is given by Long and Freese (2006). Sometimes, we are also interested in how the eect of one variable changes when another variable changes, called the interaction eect. Because there is more than one way in which we can dene an eect in a nonlinear model, there must also be more than one way in which we can dene an interaction eect. This tip deals with how to interpret these interaction eects when we want to present eects as odds ratios or incidence-rate ratios, which can be an attractive alternative to interpreting interactions eects in terms of marginal eects. The motivation for this tip is many recent discussions on how to interpret interaction eects when we want to interpret them in terms of marginal eects (Ai and Norton 2003; Norton, Wang, and Ai 2004; Cornelien and Sonderhof 2009). (A separate concern about interaction eects in nonlinear models that is often mentioned is the possible inuence of unobserved heterogeneity on these estimates; for example, see Williams [2009]. But I will not deal with that potential problem here.) These authors point out a common mistake, interpreting the rst derivative of the multiplicative term between two explanatory variables as the interaction eect. The problem with this is that we want the interaction eect between two variables (x1 and x2 ) to represent how much the eect of x1 changes for a unit change in x2 . The eect of x1 , in the marginal eects metric, is the rst derivative of the expected value of the dependent variable (E [y ]) with respect to x1 , which is an approximation of how much E [y ] changes for a unit change in x1 . The interaction eect should thus be the cross partial derivative of E [y ] with respect to x1 and x2 that is, an approximation of how much the derivative of E [y ] with respect to x1 changes for a unit change in x2 . In nonlinear models, this is typically dierent from the rst derivative of E [y ] with respect to the multiplicative term x1 x2 . This is where programs like inteff by Norton, Wang, and Ai (2004) and inteff3 by Cornelien and Sonderhof (2009) come in.

c 2010 StataCorp LP

st0194

306

Stata tip 87: Interpretation of interactions in nonlinear models

Fortunately, we can interpret interactions without referring to any additional program by presenting eects as multiplicative eects (for example, odds ratios, incidencerate ratios, hazard ratios). However, the marginal eects and the multiplicative eects answer subtly dierent questions, and thus it is a good idea to have both tools in your toolbox. The interpretation of results is best explained using an example. Here we study whether the eect of having a college degree (collgrad) on the odds of obtaining a high job (high occ) diers between black and white women.
. sysuse nlsw88 (NLSW, 1988 extract) . generate byte high_occ = occupation < 3 if occupation < . (9 missing values generated) . generate byte black = race == 2 if race < . . drop if race == 3 (26 observations deleted) . generate byte baseline = 1 . logit high_occ black##collgrad baseline, or noconstant nolog Logistic regression Number of obs Wald chi2(4) Log likelihood = -1199.4399 Prob > chi2 high_occ 1.black 1.collgrad black# collgrad 1 1 baseline Odds Ratio .4194072 2.465411 Std. Err. .0655069 .293568 z -5.56 7.58 P>|z| 0.000 0.000

= = =

2211 504.62 0.0000

[95% Conf. Interval] .3088072 1.952238 .5696188 3.113478

1.479715 .3220524

.4132536 .0215596

1.40 -16.93

0.161 0.000

.8559637 .2824512

2.558003 .3672059

If we were to interpret these results in terms of marginal eects, we would typically look at the eect of the explanatory variables on the probability of attaining a high job. However, this example uses a logit model together with the or option, so the dependent variable is measured in the odds metric rather than in the probability metric. Odds have a bad reputation for being hard to understand, but they are just the expected number of people with a high job for every person with a low job. For example, the baseline oddsthe odds of having a high job for white women without a college degreeis 0.32, meaning that within this category, we expect to nd 0.32 women with a high job for every woman with a low job. The trick I have used to display the baseline odds is discussed in an earlier tip (Newson 2003). The odds ratio for collgrad is 2.47, which means that the odds of having a high job is 2.47 times higher for women with a college degree. There is also an interaction eect between collgrad and black, so this eect of having a college degree refers to white women. The eect of college degree for black women is 1.48 times that for white women. So the interaction eect tells how much the eect of collgrad diers between black and white women, but it does so in multiplicative terms. The results also show that this interaction is not signicant.

M. L. Buis

307

This example points to the dierence between marginal eects and multiplicative eects. Now we can compute the marginal eect as the dierence between the expected odds of women with and without a college degree, rather than as the derivative of the expected odds with respect to collgrad. The reason for computing the marginal eect as a dierence is that collgrad is a categorical variable, so this discrete dierence corresponds more closely with what would actually be observed. Although it is a slight abuse of terminology, I will continue to call it the marginal eect. The margins command below shows the odds of attaining a high job for every combination of black and collgrad. The odds of attaining a high job for white women without a college degree is 0.32, while the odds for white women with a college degree is 0.79. The marginal eect of collgrad for white women is thus 0.47. The marginal eect of collgrad for black women is only 0.36. The marginal eect of collgrad is thus larger for white women than for black women, while the multiplicative eect of collgrad is larger for black women than for white women.
. margins, over(black collgrad) expression(exp(xb())) post Predictive margins Number of obs Model VCE : OIM Expression over : exp(xb()) : black collgrad Delta-method Std. Err.

2211

Margin black# collgrad 0 0 0 1 1 0 1 1

P>|z|

[95% Conf. Interval]

.3220524 .7939914 .1350711 .4927536

.0215596 .078188 .0190606 .1032487

14.94 10.15 7.09 4.77

0.000 0.000 0.000 0.000

.2797964 .6407457 .097713 .29039

.3643084 .9472371 .1724292 .6951173

. lincom 0.black#1.collgrad - 0.black#0.collgrad ( 1) - 0bn.black#0bn.collgrad + 0bn.black#1.collgrad = 0 Coef. (1) .471939 Std. Err. .081106 z 5.82 P>|z| 0.000 [95% Conf. Interval] .3129742 .6309038

. lincom 1.black#1.collgrad - 1.black#0.collgrad ( 1) - 1.black#0bn.collgrad + 1.black#1.collgrad = 0 Coef. (1) .3576825 Std. Err. .1049933 z 3.41 P>|z| 0.001 [95% Conf. Interval] .1518994 .5634656

The reason for this dierence is that the multiplicative eects are relative to the baseline odds in their own category. In this example, these baseline odds dier substantially between black and white women: for white women without a college degree, we expect to nd 0.32 women with a high job for every woman with a low job, while for

308

Stata tip 87: Interpretation of interactions in nonlinear models

black women without a college degree, we expect to nd only 0.14 women with a high job for every woman with a low job. So even though the increase in odds as a result of getting a college degree is higher for white women than for black women, this increase as a percentage of the baseline value is less for white women than for black women. The multiplicative eects control in this way for dierences between the groups in baseline odds. However, notice that marginal and multiplicative eects are both accurate representations of the eect of a college degree. Which eect one wants to report depends on the substantive question, whether or not one wants to control for dierences in the baseline odds. The example here is relatively simple with only binary variables and no controlling variables. However, the basic argument still holds when using continuous variables and when controlling variables are added. Moreover, the argument is not limited to results obtained from logit. It applies to all forms of multiplicative eects, and so, for example, to odds ratios from other models such as ologit (see [R] ologit) and glogit ([R] glogit); relative-risk ratios ([R] mlogit); incidence-rate ratios (for example, [R] poisson, [R] nbreg, and [R] zip); or hazard ratios (for example, [ST] streg and [R] cloglog).

Acknowledgment
I thank Richard Williams for helpful comments.

References
Ai, C., and E. C. Norton. 2003. Interaction terms in logit and probit models. Economics Letters 80: 123129. Cornelien, T., and K. Sonderhof. 2009. Partial eects in probit and logit models with a triple dummy-variable interaction term. Stata Journal 9: 571583. Long, J. S., and J. Freese. 2006. Regression Models for Categorical Dependent Variables Using Stata. 2nd ed. College Station, TX: Stata Press. Newson, R. 2003. Stata tip 1: The eform() option of regress. Stata Journal 3: 445. Norton, E. C., H. Wang, and C. Ai. 2004. Computing interaction eects and standard errors in logit and probit models. Stata Journal 4: 154167. Williams, R. 2009. Using heterogenous choice models to compare logit and probit coecients across groups. Sociological Methods & Research 37: 531559.