Announcement

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

  • Get p-value for Matching within strata in psmatch2

    Hi all,

    I wonder if exist some way to get p-value in PSM within strata in psmatch2.

    I am able to calculate p-value using a naive PSM:

    Code:
    sysuse nlsw88, clear
    psmatch2 married hours collgrad industry tenure , out(wage)
    
    local pval: di %6.3f  = 2*ttail(`e(df_r)', abs(`r(att)'/`r(seatt)'))
    di "`pval'"
    0.974
    But the mehod for a within strata in psmatch2.is:

    Code:
    g att = .
    g seatt = .
    egen g = group(race)
    
    levels g, local(gr)
    
    qui foreach j of local gr {
    
            psmatch2 married hours collgrad industry tenure if g==`j', out(wage)
            replace att   = r(att)   if g== `j'
            replace seatt = r(seatt) if g== `j'
    
    }
    sum att
    Some tips??
    Thanks in advance.
    Rodrigo

  • #2
    I found an alternative methods to get p-value:

    First I compare 2 p-value methods using naive PSM:

    Code:
    sysuse nlsw88, clear
    
    g att = .
    g pvalue = .
    
    psmatch2 married hours collgrad industry tenure , out(wage)
    
    
    ----------------------------------------------------------------------------------------
            Variable     Sample |    Treated     Controls   Difference         S.E.   T-stat
    ----------------------------+-----------------------------------------------------------
                wage  Unmatched | 7.62403932   8.16453408  -.540494767   .256021246    -2.11
                            ATT | 7.62403932   7.61148867   .012550649   .390070357     0.03
    ----------------------------+-----------------------------------------------------------
    Note: S.E. does not take into account that the propensity score is estimated.
    
    
    replace att= r(att)
    
    // compare both methods
    local pval: di %9.7f  = 2*ttail(`e(df_r)', abs(`r(att)'/`r(seatt)'))
    di "`pval'"
    0.9743351
    
    replace pvalue = 2 * normal(-abs(r(att) / r(seatt)))
    tabstat att pvalue, stat(mean)
    
    
       Stats |       att    pvalue
    ---------+--------------------
        Mean |  .0125506  .9743322
    ------------------------------
    For PSM within strata in psmatch2:

    Code:
    sysuse nlsw88, clear
    
    g att = .
    g seatt = .
    g pvalue = .
    
    egen g = group(race)
    levels g, local(gr)
    
    qui foreach j of local gr {
    
            psmatch2 married hours collgrad industry tenure if g==`j', out(wage)
            
            replace att   = r(att)   if g== `j'
            replace seatt = r(seatt) if g== `j'
            
            * Calcular el p-value
            replace pvalue = 2 * normal(-abs(r(att) / r(seatt))) if g== `j'
    }
    
    tabstat att seatt pvalue, by(g) stat(mean)
    
    
           g |       att     seatt    pvalue
    ---------+------------------------------
           1 | -.2518406  .5209157  .6287709
           2 |  .3188446  .5585632  .5681149
           3 | -2.657943  2.689397  .3230036
    ---------+------------------------------
       Total | -.1315597  .5557906  .6094867
    ----------------------------------------
    p-value Total: .6094867 its ok??

    Comment

    Working...
    X