by TomDoan » Thu Aug 09, 2007 1:04 pm
There are several examples among the Greene and Verbeek textbook examples which do LM specification tests for DDV and LDV. These are all based upon the generalized residuals. See
grnp681.prg
verp197.prg
verp205.prg
If you look at 22-16 in Greene, the ai is just the generalized residual. bi can be obtained as
prj fit
set b = %if(censored,-fit*gresid/%seesq,5*(gresid**2-1.0/%seesq))
The test statistic (22-17) can be computed as in the examples cited by using MCOV with the OPGSTAT option.
The adjustment factor for marginal effects can be computed using PRJ:
ldv(censor=lower,lower=0.0) y
# constant z2 z3 z5 z7 z8
prj(scale=sqrt(%seesq),lower=0.0,cdf=adjust)