Announcement

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

  • Discrepancy between kmatch and summarize

    I'm running Stata/MP 14.2 under Windows 7. I have a question about different results between summarize and ksmatch (http://ideas.repec.org/c/boc/bocode/s458346.html). ksmatch gives me the following output:

    Code:
    . kmatch ps anesthesia encounter_age bsa2 qrs2 pulgrade pul_stenosis rightventsize lvefecho2 /*
    > */ (lvef2=encounter_age bsa2 qrs2 pulgrade pul_stenosis rightventsize lvefecho2), /*
    > */ comsup kernel(biweight) pscmd(logit) att bwidth(cv) /*
    > */ generate(_KM_treat _KM_nc _KM_nm _KM_mw) po
    (12 observations with PS outside common support)
    (computing bandwidth ................ done)
    
    Propensity-score kernel matching                Number of obs     =        117
                                                    Kernel            =   biweight
    Treatment   : anesthesia = 1
    Covariates  : encounter_age bsa2 qrs2 pulgrade pul_stenosis rightventsize lvefecho2
    PS model    : logit (pr)
    RA equations: lvef2 = encounter_age bsa2 qrs2 pulgrade pul_stenosis rightventsize lvefecho2 _cons
    
    Matching statistics
    ------------------------------------------------------------------------------------------
               |             Matched             |             Controls            | Bandwidth
               |       Yes         No      Total |      Used     Unused      Total |         
    -----------+---------------------------------+---------------------------------+----------
       Treated |        27          5         32 |        78          7         85 |    .07729
    ------------------------------------------------------------------------------------------
    
    Treatment-effects estimation
    ------------------------------------------------------------------------------
           lvef2 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
             ATT |  -6.285085   1.763609    -3.56   0.001    -9.778135   -2.792035
              Y1 |   50.03333   1.300894    38.46   0.000     47.45675    52.60992
              Y0 |   56.31842    1.16635    48.29   0.000     54.00832    58.62852
    ------------------------------------------------------------------------------
    I'm trying to reproduce the results in summarize. This works with the treatment group because the weights are 1 (at least that's the way I read the ksmatch documentation). However, I get this with summarize:

    Code:
    . summarize lvef2 if anesthesia==0 & _KM_nm~=0 & _KM_nm~=. [aw=_KM_mw]
    
        Variable |     Obs      Weight        Mean   Std. Dev.       Min        Max
    -------------+-----------------------------------------------------------------
           lvef2 |      78          27    56.22177    5.17997         42         69
    The number of obs and the sum of the weights are both correct. Can the discrepancy in the mean between ksmatch and summarize be attributed to rounding error?

  • #2
    To add to my first post, I don't think this is rounding error:

    Code:
    . kmatch ps anesthesia encounter_age bsa2 qrs2 pulgrade pul_stenosis rightventsize lvefecho2 /*
    > */ (lv_stroke_ci=encounter_age bsa2 qrs2 pulgrade pul_stenosis rightventsize lvefecho2), /*
    > */ comsup kernel(biweight) pscmd(logit) att bwidth(cv) /*
    > */ generate(_KM_treat _KM_nc _KM_nm _KM_mw) po
    (12 observations with PS outside common support)
    (computing bandwidth ................ done)
    
    Propensity-score kernel matching                Number of obs     =        117
                                                    Kernel            =   biweight
    Treatment   : anesthesia = 1
    Covariates  : encounter_age bsa2 qrs2 pulgrade pul_stenosis rightventsize lvefecho2
    PS model    : logit (pr)
    RA equations: lv_stroke_ci = encounter_age bsa2 qrs2 pulgrade pul_stenosis rightventsize lvefecho2 _cons
    
    Matching statistics
    ------------------------------------------------------------------------------------------
               |             Matched             |             Controls            | Bandwidth
               |       Yes         No      Total |      Used     Unused      Total |         
    -----------+---------------------------------+---------------------------------+----------
       Treated |        27          5         32 |        78          7         85 |    .07729
    ------------------------------------------------------------------------------------------
    
    Treatment-effects estimation
    ------------------------------------------------------------------------------
    lv_stroke_ci |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
             ATT |  -920.1606   224.4979    -4.10   0.000    -1364.807   -475.5143
              Y1 |   2789.762   176.3627    15.82   0.000     2440.454    3139.071
              Y0 |   3709.923   187.9456    19.74   0.000     3337.673    4082.173
    ------------------------------------------------------------------------------
    Code:
    . summarize lv_stroke_ci if anesthesia==0 & _KM_nm~=0 & _KM_nm~=. [aw=_KM_mw]/*keep-post-match*/
    
        Variable |     Obs      Weight        Mean   Std. Dev.       Min        Max
    -------------+-----------------------------------------------------------------
    lv_stroke_ci |      78          27     3594.92   706.5085       2070     5262.1
    This is a much larger discrepancy. I still can't figure out how the n and the sum of the weights can be correct, and not have the summarize return the same means. Anybody have any ideas?

    Comment

    Working...
    X