Code: Select all
'Example 17.10 (p. 715) of Greene, William H. (2012) Econometric Analysis, 7th edition, Prentice-Hall.
wfopen http://www.stern.nyu.edu/~wgreene/Text/Edition7/TableF5-1.txt
logl hetprobit
hetprobit.append @logl maxlik
hetprobit.append index = c(1) + c(2)*wa + c(3)*wa^2 + c(4)*faminc + c(5)*we + c(6)*((kl6+k618)>0)
hetprobit.append sig = @exp(c(7)*((kl6+k618)>0)+c(8)*faminc)
hetprobit.append adjindex = index/sig
hetprobit.append maxlik = lfp*log(1-@cnorm(-adjindex)) + (1-lfp)*log(@cnorm(-adjindex))
hetprobit.ml(optmethod=legacy)
'Heteroscedasticity test (Wald)
freeze(mode=overwrite,waldtest) hetprobit.wald c(7)=0, c(8)=0