# What are average partial effects?

Does anybody know the meaning of average partial effects? What exactly is it and how can I calculate them? Here is a reference that might help.

I don’t think there is a consensus on terminology here, but the following is what I think most people have in mind when someone says “average partial effect” or “average marginal effect”.

Suppose, for concreteness, that we are analyzing a population of people. Consider the linear model
$$Y=βX+U, Y = \beta X + U,$$
where $$(Y,X)(Y,X)$$ are observed scalar random variables, and $$UU$$ is an unobserved scalar random variable. Suppose that $$β\beta$$ is an unknown constant. Suppose this is a structural model, meaning that it has a causal interpretation. So, if we could pick a person out of the population and increase their value of $$XX$$ by 1 unit, then their value of $$YY$$ would increase by $$β\beta$$. Then $$β\beta$$ is called the marginal or causal effect of $$XX$$ on $$YY$$.

Now, assuming that $$β\beta$$ is a constant means that no matter which person we pick out of the population, a one unit increase in $$XX$$ has the same effect on $$YY$$ — it increases $$YY$$ by $$β\beta$$. This is clearly restrictive. We can relax this constant effect assumption by supposing that $$β\beta$$ itself a random variable — each person has a different value of $$β\beta$$. Consequently, there is an entire distribution of marginal effects, the distribution of $$β\beta$$. The mean of this distribution, $$E(β)E(\beta)$$, is called the average marginal effect (AME), or average partial effect. If we were to increase everyone’s value of $$XX$$ by one unit, then the average change in $$YY$$ is given by the AME.

Alternatively, consider the nonlinear model
$$Y=m(X,U), Y = m(X,U),$$
where again $$(Y,X)(Y,X)$$ are scalar observables and $$UU$$ is a scalar unobservable, and $$mm$$ is some unknown function (assume it is differentiable for simplicity). Here the causal/marginal effect of $$XX$$ on $$YY$$ is $$∂m(x,u)/∂x\partial m(x,u)/\partial x$$. This value may depend on the value of $$UU$$. Thus, even if we look at people who all have the same observed value of $$XX$$, a small increase in $$XX$$ will not necessarily increase $$YY$$ by the same amount, because each person may have a different value of $$UU$$. Thus there is a distribution of marginal effects, just as in the linear model above. And, again, we can look at the mean of this distribution:
$$EU∣X[∂m(x,U)∂x∣X=x]. E_{U \mid X} \left[ \frac{\partial m(x,U)}{\partial x} \mid X=x \right].$$
This mean is called the average marginal effect, given $$X=xX=x$$. If we assume $$UU$$ is independent of $$XX$$, as is sometimes done, then the AME at $$X=xX=x$$ is simply
$$EU[∂m(x,U)∂x]. E_{U} \left[ \frac{\partial m(x,U)}{\partial x} \right].$$
In general, an average marginal effect is just a derivative (or sometimes a finite difference), of a structural function (such as $$m(x,u)m(x,u)$$ or $$βx+u\beta x + u$$) with respect to an observed variable $$XX$$, averaged over an unobserved variable $$UU$$, perhaps within a particular subgroup of people with $$X=xX=x$$. The precise form of this effect depends on the specific model under consideration.

Also note that these objects might also be called average treatment effects, especially when considering a finite difference. For example, the difference of the structural function at $$X=1X=1$$ (‘treated’) and at $$X=0X=0$$ (‘untreated’), averaged over the unobservables.

Finally, to be clear, note that when I refer to ‘distributions’ above, I mean distributions over the population of people. Each person in the population has a value of $$UU$$, of $$XX$$, and of $$YY$$. Hence there is a distribution of these values if I look over all people in the population. The thought experiment here is the following. Take all people with $$X=xX=x$$. Now take one of these people, and increase their $$XX$$ value by a small amount, but keep their $$UU$$ value the same, and we write down the change in their $$YY$$ value. We do this for each person with $$X=xX=x$$, and then average the values. This is what it means to average over $$U∣X=xU \mid X=x$$.