# Diagnostic testing in nonlinear models of conditional means

Much of what we discussed in Section 2.1 carries over to nonlinear models. With a nonlinear conditional mean function, it becomes even more important to state hypotheses in terms of conditional expectations; otherwise the null model has no interesting interpretation. For example, if y is a nonnegative response, a convenient regression function is exponential:

E( y|x) = exp(xp), (9.31)

where, for simplicity, unity is included in the 1 x k vector x. Importantly, (9.31) puts no restrictions on the nature of y other than that it is nonnegative. In particular, y could be a count variable, a continuous variable, or a variable with discrete and continuous characteristics. We can construct a variety of alternatives to (9.31). For example, in the more general model

E(y |x) = exp(xp + 51(xp)2 + 52(xp)3), (9.32)

we can test H0 : 51 = 0, 52 = 0.

Generally, if we nest E(y |x) = m(x, P) in the model q(x, p, 5), where m(x, P) = q(x, p, 50), for a known value 50, then the LM statistic is easy to compute: LM = N ■ Rl from the regression

й on Vpm;, V5{, i = 1, 2,…, N, (9.33)

where й = у; – m(xu S), Vm = Vpm(x,, S), and V5{ = V5q(x,•, S, 50); S is the

nonlinear least squares (NLS) estimator obtained under H0. (The R2 is generally the uncentered R2.) Under H0 : E(у |x) = m(x, P) and the homoskedasticity assumption (9.15), LM ~ x2, where q is the dimension of 5. For testing (9.31) against (9.32), Vffi = x, exp(x, S) and V5{i = ((x ,S)2exp(x, S), (x, S)3exp(x; S)); the latter is a 1 x 2 vector.

Davidson and MacKinnon (1985) and Wooldridge (1991a) show how to obtain a heteroskedasticity-robust form of the LM statistic by first regressing V5{i on Vn, and obtaining the 1 x q residuals, r,, and then computing the statistic exactly as in (9.23).

For more general tests, V5{, is replaced by a set of misspecification indicators, say g,-. For example, if we are testing H0 : E(у |x) = m(x, P) against H1 : E(у |x) = fi(x, y), the Davidson-MacKinnon (1981) test takes i – m, the difference in the fitted values from the two models. Wooldridge’s (1990b) conditional mean encompassing (CME) test takes g, = VY{, = VYq(x;, у), the 1 x q estimated gradient from the alternative mean function.

It is straightforward to obtain conditional mean tests in the context of maximum likelihood or quasi-maximum likelihood estimation for densities in the linear exponential family (LEF). As shown by Gourieroux, Monfort, and Trognon (1984), the quasi-MLE is consistent and asymptotically normal provided only that the conditional mean is correctly specified. The tests have the same form as those for nonlinear regression, except that all quantities are weighted by the inverse of the estimated conditional standard deviation – just as in weighted nonlinear least squares. So, in (9.33), we would divide each quantity by h1/2, where H, = v(x ;, 0) is the estimated conditional variance function from the LEF density, under H0. For example, in the case of the binary response density, H, = m;(1 – m,), where m; would typically be the logit or probit function. (See Moon

(1988) for some examples of alternative conditional mean functions for the logit model.) For Poisson regression, Hj = m, where m, = exp(x,0) is the usual conditional mean function under H0 (see Wooldridge (1997) for further discussion). The statistic from (9.33), after quantities have been appropriately weighted, is valid when var(y; |x;) is proportional to the variance implied by the LEF density. The statistic obtained from (9.23) is robust to arbitrary variance misspecification, provided й; is replaced with й;/н1/2 and r, is replaced with the residuals from the multivariate regression Vs{;/ H1/2 on Vpm;/ H1/2; see Wooldridge (1991b, 1997) for details.

## Leave a reply