Dear all,
I am struggling to find the right code for RESET test in Stata after running Heckman and Two-Part model.
Could you check the below code and confirm if I am correctly generating the fitted values and squaring them?
*DV represents dependent and IV represents independent variable and dy represents DV>0
Best regards,
Imran Khan
I am struggling to find the right code for RESET test in Stata after running Heckman and Two-Part model.
Could you check the below code and confirm if I am correctly generating the fitted values and squaring them?
Code:
*RESET Test for Heckman Model heckman DV IV, select(dy = IV) twostep predict double fito, xb predict double xg, xbsel gen double fith=exp(fito+0.5*e(sigma)^2+log(normal(xg+ e(rho)*e(sigma)))) * Square the fitted values gen fith2=fith^2 * Estimate the model with the additional regressor heckman DV IV fith2, select(dy = IV fith2) twostep * Test the significance of the additional regressor (this is equivalent to a t-test on fit2) test fith2=0
Code:
*Performing Two Part Model probit dy IV, nolog regress DV IV if dy==1 *RESET Test for Two Part Model probit dy IV, nolog predict fit, xb gen fit2=fit^2 probit dy IV fit2, nolog test fit2=0
Best regards,
Imran Khan
Comment