Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Inverse Mill's Ratio - A Comment

    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

    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 |
         +-------------------------------------------------------------+
    My best regards
    Last edited by Emad Shehata; 07 Jul 2016, 02:29.
    Emad A. Shehata
    Professor (PhD Economics)
    Agricultural Research Center - Agricultural Economics Research Institute - Egypt
    Email: [email protected]
    IDEAS: http://ideas.repec.org/f/psh494.html
    EconPapers: http://econpapers.repec.org/RAS/psh494.htm
    Google Scholar: http://scholar.google.com/citations?...r=cOXvc94AAAAJ

  • #2
    On spelling and punctuation only, see http://www.stata.com/statalist/archi.../msg00433.html

    I copy the substantive contents here.

    st: Mills' ratio

    From "Nick Cox"
    To <[email protected]>
    Subject st: Mills' ratio
    Date Sun, 13 Mar 2005 17:26:00 -0000


    The dreaded "mill's ratio" made another appearance recently. Other mutations appear intermittently.

    The correct naming is easy to determine.

    This ratio is named for John P. Mills whose tabulation appears in

    Table of the Ratio: Area to Bounding Ordinate, for Any Portion of Normal Curve. Biometrika 18: 395--400 (1926)

    Thus allowing for differences of opinion on what should be punctuated and how, three (and only three) variations appear acceptable.

    Mills ratio

    Mills' ratio

    Mills's ratio
    This is a hard name to get right even for people for whom English or American is their first language.

    Comment

    Working...
    X