With thanks as usual to Kit Baum, a new program underid by myself and Frank Windmeijer is now available on SSC.

underid provides postestimation tests of under- and over-identification after linear IV estimation, including static and dynamic panel data models. Supported estimators: ivregress, ivreg2, xtivreg, xtivreg2, xtabond2, xtdpdgmm, xthtaylor.

Tests available include classical (unrobust) and robust tests, including Anderson's canonical correlations test, Cragg-Donald, Kleibergen-Paap, and GMM-based tests (both 2-step GMM and CUE). The Sanderson-Windmeijer test of specific endogenous regressors is also supported.

A detailed description of the tests implemented is in the underid help file; for the econometric nitty-gritty, see Frank's paper here: https://ideas.repec.org/p/bri/uobdis/18-696.html