Angrist and Newey's test is based on the results of the
artifactual regression of the within residuals on the covariates for
all the period.
References
Angrist, J.D. and Newey, W.K. (1991). Over-identification tests in
earnings functions with fixed effects, Journal of Business &
Economic Statistics, 9(3), pp. 317--323.