# LDECOMP: Stata module decomposing the total effects in a logistic regression into direct and indirect effects

*Maarten Buis* ()

Statistical Software Components from Boston College Department of Economics

**Abstract:**
ldecomp decomposes the total effects of a categorical variable in logistic regresion into direct and indirect effects using a method method by Erikson et al. (2005) and a generalization of this method by Buis (2008). Consider an example where social class has an indirect effect on attending college through academic performance in high school. The indirect effect is obtained by comparing the proportion of lower class students that attend college with the counterfactual proportion of lower class students if they had the distribution of performance of the higher class students. This captures the association between class and attending college due to differences in performance. The direct effect of class is obtained by comparing the proportion of higher class students with the counterfactual proportion of lower class students if they had the same distribution of performance as the higher class students. This way the variable performance is kept constant. If these comparisons are carried out in the form of log odds ratios than the total effect will equal the sum of the direct and indirect effects. In its original form this method assumes that the variable through which the indirect effect occurs is normally distributed. This is generalized by Buis (2008) by allowing this variable to have any distribution, which has the added advantage of simplifying the method.

**Language:** Stata

**Requires:** Stata version 9.0

**Keywords:** logistic regression; logit; mediation; direct and indirect effects (search for similar items in EconPapers)

**Date:** 2008-01-29, Revised 2014-01-17

**Note:** This module should be installed from within Stata by typing "ssc install ldecomp". Windows users should not attempt to download these files with a web browser.

**References:** Add references at CitEc

**Citations** Track citations by RSS feed

**Downloads:** (external link)

http://fmwww.bc.edu/repec/bocode/l/ldecomp.ado program code (text/plain)

http://fmwww.bc.edu/repec/bocode/_/_ldecomp.ado program code (text/plain)

http://fmwww.bc.edu/repec/bocode/l/ldecomp.hlp help file (text/plain)

http://fmwww.bc.edu/repec/bocode/w/wisconsin.dta sample data file (application/x-stata)

**Related works:**

This item may be available elsewhere in EconPapers: Search for items with the same title.

**Export reference:** BibTeX
RIS (EndNote, ProCite, RefMan)
HTML/Text

**Persistent link:** https://EconPapers.repec.org/RePEc:boc:bocode:s456906

**Ordering information:** This software item can be ordered from

http://repec.org/docs/ssc.php

Access Statistics for this software item

More software in Statistical Software Components from Boston College Department of Economics Boston College, 140 Commonwealth Avenue, Chestnut Hill MA 02467 USA. Contact information at EDIRC.

Bibliographic data for series maintained by Christopher F Baum ().