Inverse Mills' Ratio - Comment
- It is imporyant to read this article
Why are there so many formulas for the inverse of Mills’ ratio?
http://www.stata.com/support/faqs/st...e-mills-ratio/
- If model is nonselection, the natural choice for the nonselection hazard is [PDF/(1-CDF)]
as in: IMR1 - IMR2 - IMR3 - IMR4
- If model is selection, the natural choice for nonselection hazard is [PDF / CDF]
as in: IMR5 - IMR6 [Stata’s heckman command]
the next example will explain different methods to compute Inverse Mills' Ratio from probit regression
My best regards
- It is imporyant to read this article
Why are there so many formulas for the inverse of Mills’ ratio?
http://www.stata.com/support/faqs/st...e-mills-ratio/
- If model is nonselection, the natural choice for the nonselection hazard is [PDF/(1-CDF)]
as in: IMR1 - IMR2 - IMR3 - IMR4
- If model is selection, the natural choice for nonselection hazard is [PDF / CDF]
as in: IMR5 - IMR6 [Stata’s heckman command]
the next example will explain different methods to compute Inverse Mills' Ratio from probit regression
Code:
clear all input y x 0 1.9 0 2.4 0 1.1 0 0.5 0 1.2 1 3.6 1 9.1 1 8.1 1 9.8 1 3.3 0 6.6 0 6.1 end * PDF = Probability Density Function * CDF = Cumulative Density Function * pdf = normalden(xb) = normd(xb) * cdf = normal(xb) = normprob(xb) probit y x predict cdf1 , pr predict xb , xb gen double pdf1 = exp(-(xb^2/2))/sqrt(2*_pi) gen double pdf = normalden(xb) gen double cdf = normal(xb) * Inverse Mills' Ratio from [predict probit postestimation] predict IMR1 , score gen double IMR2 = pdf/cdf replace IMR2 = pdf/(cdf-1) if y == 0 gen double IMR3 = cond(y == 1, pdf/cdf, pdf/(cdf-1)) gen double IMR4 = y*(pdf/cdf) + (1-y)*pdf/(cdf-1) gen double IMR5 = exp(-(xb^2/2))/(sqrt(2*_pi)*normal(xb)) gen double IMR6 = normalden(xb)/normal(xb) format y %10.0f format xb pdf pdf1 cdf cdf1 IMR1 IMR2 IMR3 IMR4 IMR5 IMR6 %10.4f list y xb pdf pdf1 cdf cdf1 list y IMR1 IMR2 IMR3 IMR4 IMR5 IMR6
HTML Code:
list y xb pdf pdf1 cdf cdf1 +-------------------------------------------------+ | y xb pdf pdf1 cdf cdf1 | |-------------------------------------------------| 1. | 0 -1.0656 0.2261 0.2261 0.1433 0.1433 | 2. | 0 -0.9097 0.2638 0.2638 0.1815 0.1815 | 3. | 0 -1.3151 0.1680 0.1680 0.0942 0.0942 | 4. | 0 -1.5022 0.1291 0.1291 0.0665 0.0665 | 5. | 0 -1.2839 0.1750 0.1750 0.0996 0.0996 | |-------------------------------------------------| 6. | 1 -0.5355 0.3456 0.3456 0.2961 0.2961 | 7. | 1 1.1796 0.1990 0.1990 0.8809 0.8809 | 8. | 1 0.8677 0.2738 0.2738 0.8072 0.8072 | 9. | 1 1.3978 0.1502 0.1502 0.9189 0.9189 | 10. | 1 -0.6291 0.3273 0.3273 0.2646 0.2646 | |-------------------------------------------------| 11. | 0 0.4000 0.3683 0.3683 0.6554 0.6554 | 12. | 0 0.2441 0.3872 0.3872 0.5964 0.5964 | +-------------------------------------------------+ . list y IMR1 IMR2 IMR3 IMR4 IMR5 IMR6 +-------------------------------------------------------------+ | y IMR1 IMR2 IMR3 IMR4 IMR5 IMR6 | |-------------------------------------------------------------| 1. | 0 -0.2639 -0.2639 -0.2639 -0.2639 1.5780 1.5780 | 2. | 0 -0.3222 -0.3222 -0.3222 -0.3222 1.4533 1.4533 | 3. | 0 -0.1855 -0.1855 -0.1855 -0.1855 1.7829 1.7829 | 4. | 0 -0.1383 -0.1383 -0.1383 -0.1383 1.9406 1.9406 | 5. | 0 -0.1943 -0.1943 -0.1943 -0.1943 1.7570 1.7570 | |-------------------------------------------------------------| 6. | 1 1.1672 1.1672 1.1672 1.1672 1.1672 1.1672 | 7. | 1 0.2259 0.2259 0.2259 0.2259 0.2259 0.2259 | 8. | 1 0.3392 0.3392 0.3392 0.3392 0.3392 0.3392 | 9. | 1 0.1634 0.1634 0.1634 0.1634 0.1634 0.1634 | 10. | 1 1.2368 1.2368 1.2368 1.2368 1.2368 1.2368 | |-------------------------------------------------------------| 11. | 0 -1.0687 -1.0687 -1.0687 -1.0687 0.5619 0.5619 | 12. | 0 -0.9595 -0.9595 -0.9595 -0.9595 0.6493 0.6493 | +-------------------------------------------------------------+
Comment