Announcement

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

  • Propensity Score Matching Panel Data

    Hi all,

    I have the following data and problem:

    Data set: I have a sample of firms that experienced a certain event in one or more years (treatment group) as well as a sample of firms as control group. I have panel data of these firms for the years 2000-2015 as well as an additional data set which includes a dummy variable which can change throughout the year (e.g. for control firm C the variable has the value 0 for the period 01/01/2000 until 03/04/2005 and 1 for the period 04/04/2005 until 31/12/2015).

    Problem: I now want to do two things:

    1) Match the firms of the treatment group with companies from the control group based on the propensity score for the respective years (e.g. treatment firm A from the treatment group which experienced the event in 2005 should be matched with a firm from the control group from the year 2005). I would do this similar to the way described here: http://www.stata.com/statalist/archi.../msg00073.html.

    2) As a next step and based on the matching, I want to add the data from the additional data set to the matched firms (e.g. treatment firm A experienced the event on 06/06/2005 and has been matched with control firm C and I would like to add the status at that time for C, i.e. the value 1 for the dummy variable). Any recommendation on how this could be done the best way?

    Thanks in advance,
    Felix

    Illustrative data overview:
    Starting point:
    1.
    year firm_id treatment event_date
    2005 10001 1 06062005
    ... ... ... ...
    2005 10002 0 .
    2.
    firm_id start_date end_date status
    10001 01012000 31122015 0
    10002 01012000 03042005 0
    10002 04042005 31122015 1
    Desired result:
    year firm_id treatment event_date ... status
    2005 10001 1 06062005 ... 0
    ... ... ... ... ... ...
    2005 10002 0 . ... 1
    Last edited by Felix Stein; 03 Jul 2016, 22:01.

  • #2
    As nobody seems to have an answer, I try to formulate the task simplified and differently:

    1) In a first step I need to match companies based on certain characteristics using the propensity score matching (preferably psmatch2 as this allows to save the pairs)
    2) After having matched the companies, I need to obtain data (i.e. the status shown above) from the control groups based on the respective matched treatment firm (how this could be done is understood)
    3) For the additional obtained data, I want to see whether these differ between treatment and control group (i.e. the outcome variable used in the psmatch2 command)


    Neglecting step number 2, I tried the following based on the public nlswork data set:
    Code:
    set more off
    clear
    webuse nlswork
    drop if hours == .
    drop if union == .
    
    ** 1. Step
    *Calculate pscores
    logit union collgrad age tenure not_smsa c_city south nev_mar
    
    predict pscore if e(sample), pr
    
    * Enfore with-in year matching
    gen pscore2=year*10+pscore
    
    * Match treatment and control and save respective matching pairs
    gen u=uniform()
    sort u
    psmatch2 union, pscore(pscore2) caliper(0.5) noreplace neighbor(1)
    
    gen pair = _id if _treated==0
    replace pair = _n1 if _treated==1
    bysort pair: egen paircount = count(pair)
    drop if paircount !=2
    
    rename pair pair1
    
    rename paircount paircount1
    
    egen newid = group(pair1)
    
    ** 3. Step
    * Calculate whether treatment and control firm differ with respect to the hypothetical added variable hours
    psmatch2 union, pscore(pscore2) outcome(hours) caliper(0.5) noreplace neighbor(1)
    
    gen pair = _id if _treated==0
    replace pair = _n1 if _treated==1
    bysort pair: egen paircount = count(pair)
    drop if paircount !=2
    
    gen diff = newid - pair
    table diff
    Variable diff shows that the same pairs have been used in both steps 1 and 3. My problem is that I don't know whether this procedure can be used or is neglecting certain aspects I am currently not aware of. Once again, thanks in advance for every comment/feedback/recommendation!

    Comment

    Working...
    X