Announcement

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

  • Kernel matching & difference-in-difference (psmatch2 vs. diff)

    Hello,

    I'm using the user-written "diff" command to conduct a Kernel matching difference-in-difference estimation. To check if I did everything correct, I tried to replicate the results from the diff command by using psmacht2 to calculate the matching weights and subsequently I run a difference-in-difference OLS regression. However, I have troubles to replicate the results exactly and I do not understand why there is a difference. Therefore, I was wondering whether anyone would be so kind to help me.

    Both commands use a bandwidth and the same kernel type. Moreover, the help file of diff states that diff is using psmatch2 to perform the kernel matching.

    Here is the code I am using for the diff command:

    -----------
    #delimit ;
    diff outcome_besch,
    treat(gruppe_alt) period(periode_alt)
    kernel bw(${bw}) logit id(${id}) support
    cov(${ind_var})
    addcov(${l_ind_var})
    report
    ;
    #delimit cr
    -----------


    And this is the code for the psmatch2 command (incl. the diff-in-diff regression):

    -----------
    #delimit ;
    psmatch2 gruppe_alt
    $ind_var
    if periode_alt==0 & outcome_besch!=.
    , logit kernel bwidth(${bw}) common
    ;
    #delimit cr

    sort idnum periode_alt
    replace _weight = _weight[_n-1] if idnum==idnum[_n-1]

    reg outcome_besch i.gruppe_alt##i.periode_alt ${ind_var} [aw=_weight]
    -----------

    I encounter two main problems, which may be related to each other:

    1. The propensity score, estimated via a logit regression, is not identical using diff and psmatch2. By looking at the program code, I found that the diff command is using a “float” variable for estimating the propensity score, whereas the psmatch2 command uses a “double” variable.
    a. Is there a reason why one should use the less precise “float” variable?
    b. Even if I change the program code of the diff command in that manner that “double” variables are used, a small difference remains; even though the extent of the difference declined.
    If I run a separate logit command (logit gruppe_alt $ind_var if periode_alt==0 & outcome_besch!=.), I obtain the results which I get from the psmatch2 command. The results from the diff command are slightly different. What are I am doing wrong? I found no reason for this difference in the program code of the diff command. However, I'm not an expert in writing own Stata commands.

    2. One observation is labeled “on support” by psmatch2 (and thus gets a weight higher than zero) but the same observation gets a weight of zero by using the diff command. Interestingly, this is the treated observation with the lowest propensity score of the sample. Why is there a difference between the diff command and the psmatch2 approach?

    Thank you very much for your help!

    Best regards,
    Sebastian
Working...
X