nlcom and the Delta Method in Stata

What is the Delta Method?

I have used the delta method occasionally for years without really understanding what is going on under the hood. An encounter with an inquisitive reviewer has changed that. As it turned out, the delta method is even more useful than sliced bread, and much healthier.

The delta method, whose foundations were laid in the 1940s by Cramér (Oehlert 1992), approximates the expectation (or higher moments) of some function g(\cdot) of a random variable x by relying on a (truncated) Taylor series expansion. More specifically, Agresti (2002: 578) shows that (under weak conditions) for some parameter \theta that has an approximately normal sampling distribution with variance \sigma^{2}/n, the sampling distribution of g(\theta) is also approximately normal with variance [g'(\theta)]^{2}\sigma^2/n, since g(\cdot) is approximately linear in the neighbourhood of \theta. The delta method can be generalised to the case of a multivariate normal random vector (Agresti 2002: 579) such as the joint sampling distribution of some set of parameter estimates.

In plain words, that means that one can use the delta method to calculate confidence intervals and perform hypothesis tests on just about every linear or nonlinear transformation of a vector of parameter estimates. If you are interested in the ratio of two coefficients and need a confidence interval, use the delta method. If, for some reason, you need to know if e^{\beta} >c with some probability, the delta method is your friend. Have I already mentioned sliced bread?

The Delta Method in Stata: nlcom

Stata’s procedure nlcom is a particularly versatile and powerful implementation of the delta method. As a post-estimation command, nlcom accepts symbolic references to model parameters and computes sampling variances for their linear and non-linear combinations  and transformations. If you can write down the formula of the transformation, nlcom will spit out the result, standard error and confidence interval, and will even store the full variance-covariance matrix of the estimates. That, in turn, means that, amongst other things, you can abuse Stata’s built-in procedures to implement your own estimators.

What’s not to like? Well, for one thing, Stata gives no indication of how well the approximation works. It’s always worth checking that the results look reasonable, and in particularly complex circumstances, one should use simulation/bootstrapping for double-checking. And that’s about the only complaint. Basically, nlcom is great fun.

References

Agresti, Alan. 2002. Categorical Data Analysis. 2 ed. Hoboken: John Wiley.

Oehlert, Gary W. 1992. “A Note on the Delta Method.” The American Statistician
46(1):27–29.

nlcom and the Delta Method in Stata 2

Discover more from kai arzheimer

Subscribe to get the latest posts sent to your email.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Find out more about Webmentions.)