Announcement

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

  • kmatch bandwidth

    I am running Stata 14.2 on Win 7E. I'm using propensity score matching on some observational data. I've managed to get my models to run using psmatch2. One of the drawbacks of this command is that the bandwidth is not optimized. I believe that kmatch (http://www.statalist.org/forums/foru...score-matching) might do that for me, however, it's much more complicated.

    This is my psmatch2 code:

    Code:
    psmatch2 anesthesia encounter_age bsa2 qrs2  pulgrade pul_stenosis rightventsize lvefecho2, /*
    */kernel(biweight) common logit
    This code does not produce matching statistics, but if I specify an outcome I get the following:

    Code:
     psmatch2: |   psmatch2: Common
     Treatment |        support
    assignment | Off suppo  On suppor |     Total
    -----------+----------------------+----------
     Untreated |         0         84 |        84
       Treated |         5         27 |        32
    -----------+----------------------+----------
         Total |         5        111 |       116

    Here is my kmatch code:

    Code:
    kmatch ps anesthesia encounter_age bsa2 qrs2  pulgrade pul_stenosis rightventsize lvefecho2, /*
    */comsup kernel(biweight) pscmd(logit) att
    My kmatch code produces this:

    Code:
    Propensity-score kernel matching                Number of obs     =        116
                                                    Kernel            =   biweight
    Treatment   : anesthesia = 1
    Covariates  : encounter_age bsa2 qrs2 pulgrade pul_stenosis rightventsize lvefecho2
    PS model    : logit (pr)
    
    Matching statistics
    ------------------------------------------------------------------------------------------
               |             Matched             |             Controls            | Bandwidth
               |       Yes         No      Total |      Used     Unused      Total |         
    -----------+---------------------------------+---------------------------------+----------
       Treated |        27          5         32 |        77          7         84 |  .0612906
    ------------------------------------------------------------------------------------------
    It seems that I'm getting the right numbers in total. However, it's not clear if this program is restricted to cases with common support. My other question is about the bandwidth. I think .0612906 is very close to the default. I tried to specify the bw option on kmatch, but I received the following error:

    Code:
    . kmatch ps anesthesia encounter_age bsa2 qrs2  pulgrade pul_stenosis rightventsize lvefecho2, /*
    > */comsup kernel(biweight) pscmd(logit) bw(silverman) att
    bwidth(): silverman not allowed
    r(198);
    
    end of do-file
    Silverman is the default, but I'm not sure it's being implemented when I specify no bandwidth. It seems that it should run when this option is explicitly specified, but that's not working. Anyone have any suggestions?

  • #2
    Bandwidth: bwidth(silverman) is not a valid option of kmatch. The default for kernel matching is bwidth(pm), which uses a pair-matching algorithm to determine the bandwidth. For details, see the bwidth() option in help kmatch.

    Common support: if you specify comsup without arguments, kmatch ps omits observations outside the common range of the propensity score, where "the common range is defined as the range between max(min(ps|treatment), min(ps|control)) and min(max(ps|treatment), max(ps|control)), where ps is the propensity score" (quote from the help file). In other words, only observations within the overlap of the propensity score between treatment group and control group are considered as potential matches.

    Comment


    • #3
      I have a somewhat related issue with kmatch and psmatch2 . I tried to implement the same matching procedure with both commands but kmatch uses a lot less control observations. The "matching statistics" automatically returned by kmatch and the common support table automatically returned by psmatch do not add up: the former reports 68/160 control units used, the latter reports all 160/160 on common support. Both use the same number of treatment unit.

      Code:
      kmatch ps D (Y), pscore(PSD) kernel(epan) bwidth(0.05) att
      
      psmatch2 D, outcome(Y) pscore(PSD) kernel bwidth(0.05)
      where D is a treatment dummy, Y is my outcome, PSD is the propensity score. Neither variable has any missings. The psmatch default is kernel(epan) and att. As I understand it, with the kenel, all control units within a 0.05 PS distance of a treatment unit should be matched and receive a wheight. So I do not understand why the number of control units matched differs.

      Are there some different default settings that I am missing? Or do the two commands report something different i.e. does the number of "untreated units on common support" (psmatch2 output) not refer to the same thing as "controls used" (kmatch output )?

      I've also posted in another forum, so far without answer.
      Last edited by Anis Oger; 12 Mar 2023, 10:13.

      Comment


      • #4
        As someone who watches Stack Overflow too: thanks for alerting us to cross-posting and my guess is that you're more likely to get a good answer here.

        Comment

        Working...
        X