An important open question in sociology with obvious policy implications is how to assess the magnitude of the effect of educational attainment on intergenerational social mobility. To examine this, we propose a general method of path analysis, which can be used to estimate direct and indirect effects even in systems where some of the variables are categorical. It provides an additive decomposition of total effects which is exact when the effects are expressed as mean differences, and approximate but typically quite accurate for other measures of association such as log-odds-ratios. Estimates of the effects and their standard errors can be calculated by using standard output for fitted models. The method is illustrated by an analysis of British survey data on social mobility. Copyright (c) 2009 Royal Statistical Society.