?=================================================================== ? Normality test for the tobit model using the method of Pagan = ? and Vella; conditional moment test. = ? = ? User must define the data matrix with the following line: = ? = ? NAMELIST ; X = ... $ = ? = ? User's dependent variable is Y. Change the following line = ? = ? CREATE ; Y = the dependent variable $ = ? = ? Two lines marked by a row of *'s below must be changed. = ?=================================================================== ? ? Estimate the model assuming normality ? TOBIT ; Lhs = Y ; Rhs = X $ ? ? Compute derivatives and terms in conditional moments. Note that ? derivatives with respect to X are each X times the same scalar. ? CREATE ; q1 = y > 0 ; q0 = 1 - q1 ; bxs = dot(X,b)/s ; e = y - s*bxs ; lam = n01(bxs) / (1 - phi(bxs)) ; dfdb = (q1 * e/s - q0 * lam) / s ; dfds = (q1 * ((e/s)^2 - 1) + q0 * lam * bxs)/s ; u3 = q1 * 0 - q0 * s^3 * lam * (2 + bxs ^ 2) ; u4 = q1 * 3 * s^4 + q0 * s^4*(3 + 3*lam*bxs + lam * bxs^3) $ ? ? Now apply the procedure detailed in Section 19.7 ? CREATE ; m1 = u3 ; m2 = u4 - 3*s^4 ; d1 = dfdb * x1 ; d2 = dfdb * x2 ; ... for each X in the Tobit equation ********************* ; ds = dfds $ NAMELIST ; M = m1,m2 ; D = d1,d2,...,ds $ ********************* CALCULATE ; lmstat=0 $ MATRIX ; MI = Xdot(M,one) ; V = RCPM (D,M) ; LMSTAT = MI' | SINV(V) | MI $ CALCULATE ; LMSTAT ; Q = Col(M) ; Chi (LMSTAT,Q) $