* * Example 21.4 from pp 681-682 * open data tablef4-1[1].txt data(format=prn,org=columns,skip=36) 1 753 lfp whrs kl6 k618 wa we ww rpwg hhrs ha he hw faminc mtr wmed wfed un cit * set logearn = log(whrs*ww) set agesq = wa**2 set kids = (kl6+k618)>0 * ddv lfp # constant wa agesq faminc we kids exclude(title="Wald Test of Regression Fit") # wa agesq faminc we kids compute loglmain=%logl ddv(noprint) lfp # constant cdf(title="LR Test of Regression Fit") chisqr 2*(loglmain-%logl) 4 * * Sample split (Chow) test * ddv lfp # constant wa agesq faminc we compute logltot=%logl ddv(smpl=(kids==0)) lfp # constant wa agesq faminc we compute logl0=%logl ddv(smpl=(kids>0)) lfp # constant wa agesq faminc we compute logl1=%logl cdf(title="Test of Sample Split Based upon Kids") chisqr 2*(logl0+logl1-logltot) 5 * * LM test for heteroscedasticity * ddv(gresids=gr) lfp # constant wa agesq faminc we kids prj fit set z1fit = -fit*kids set z2fit = -fit*faminc mcov(opgstat=lm) / gr # %reglist() z1fit z2fit cdf(title="LM Test of Heteroscedasticity") chisqr lm 2 * * Estimation of probit with heteroscedastic errors * frml(regress,vector=bp) zfrml # constant wa agesq faminc we kids frml(regress,vector=bh) hfrml # kids faminc frml hprobit = (z=zfrml/sqrt(exp(hfrml))),%if(lfp,log(%cdf(z)),log(%cdf(-z))) nonlin bp bh maximize(pmethod=simplex,piters=10,method=bhhh) hprobit