Dear all,
I am using -predictnl- to calculate marginal effect of a dummy variable for a natural logged dependent variable after -Heckman-.
*Get ERROR message: Maximum number of iterations exceeded.
I then specify the iteration number to be 1000, get the same message.
I read from an old post about the same problem: http://www.stata.com/statalist/archi.../msg00585.html, in which rescaling the variables is recommended.
I adjust my code to be:
It worked, I can get the desired marginal effects
I wonder by doing the calculation in two steps, do I get the correct standard errors, and significance levels?
Thanks.
I am using -predictnl- to calculate marginal effect of a dummy variable for a natural logged dependent variable after -Heckman-.
Code:
predictnl ME_size3=exp(_b[#1:3.household_size_R] + `beta_lambda' * /// (((normalden(xb(#2)-`household_size_R') + _b[#2:3.household_size_R]*1))/normal(xb(#2)-`household_size_R' + _b[#2:3.household_size_R]*1) /// - (normalden(xb(#2) -`household_size_R')/normal(xb(#2)-`household_size_R'))))-1, se(Se_ME_size3) p(sig_ME_size3)
I then specify the iteration number to be 1000, get the same message.
I read from an old post about the same problem: http://www.stata.com/statalist/archi.../msg00585.html, in which rescaling the variables is recommended.
I adjust my code to be:
Code:
predictnl ME_size3log=(_b[#1:3.household_size_R] + `beta_lambda' * /// (((normalden(xb(#2)-`household_size_R') + _b[#2:3.household_size_R]*1))/normal(xb(#2)-`household_size_R' + _b[#2:3.household_size_R]*1) /// - (normalden(xb(#2) -`household_size_R')/normal(xb(#2)-`household_size_R')))), se(Se_ME_size3log) p(sig_ME_size3log)
Code:
predictnl ME_size3 = exp(ME_size3log) - 1, se(Se_ME_size3) p(sig_ME_size3)
Thanks.