Hello Statalists,

I am working on treatment effects of foreign acquisition on firms' productivity, in which I use propensity score matching to match firms that have similar characteristics (one is acquired and the other stay in domestic hand) and see how their productivity differs at the year acquisition happens and one, two years after the acquisition.

However, acquisition happens at different years for different firms, not at the same time like normal treatment effects analysis. For example:
+---------------------------------------------------------------------+
| id year foreign sfor dfor tfp |
|---------------------------------------------------------------------|
24169. | 101431115465911 2011 0 5 . 11.62445 |
24170. | 101431115465911 2012 1 5 1 12.36166 |
24171. | 101431115465911 2013 1 5 0 11.12446 |
24172. | 101431115465911 2014 1 5 0 12.46801 |
24173. | 101431115465911 2015 1 5 0 12.43914 |
24174. | 101431115465911 2016 1 5 0 12.35818

is firm that was acquired in 2012 as foreign dummy changes from 0 to 1 since 2012
*foreign dummy equates 0 if the firm is domestic and 1 if the firm is foreign-owned)
sfor is sum of foreign dummy over 6-year period
dfor is difference of foreign variable from the current year and the previous year
tfp is total factor productivity

+---------------------------------------------------------------------+
| id year foreign sforeign dforeign tfp |
|---------------------------------------------------------------------|
21475. | 101379867773091 2011 0 4 . . |
21476. | 101379867773091 2012 0 4 0 . |
21477. | 101379867773091 2013 1 4 1 . |
21478. | 101379867773091 2014 1 4 0 . |
21479. | 101379867773091 2015 1 4 0 . |
21480. | 101379867773091 2016 1 4 0 . |

similarly, is firm that was acquired in 2013
+---------------------------------------------------------------------+
| id year foreign sforeign dforeign tfp |
|---------------------------------------------------------------------|
8425. | 100955701632901 2011 0 3 . . |
8426. | 100955701632901 2012 0 3 0 . |
8427. | 100955701632901 2013 0 3 0 . |
8428. | 100955701632901 2014 1 3 1 . |
8429. | 100955701632901 2015 1 3 0 8.56148 |
8430. | 100955701632901 2016 1 3 0 . |

is firm that was acquired in 2014

+---------------------------------------------------------------------+
| id year foreign sforeign dforeign tfp |
|---------------------------------------------------------------------|
72025. | 102898093851001 2011 0 2 . . |
72026. | 102898093851001 2012 0 2 0 . |
72027. | 102898093851001 2013 0 2 0 . |
72028. | 102898093851001 2014 0 2 0 . |
72029. | 102898093851001 2015 1 2 1 11.56726 |
|---------------------------------------------------------------------|
72030. | 102898093851001 2016 1 2 0 11.73104 |

is firm that was acquired in 2015

+---------------------------------------------------------------------+
| id year foreign sforeign dforeign tfp |
|---------------------------------------------------------------------|
3157. | 100113550239501 2011 0 1 . 10.58546 |
3158. | 100113550239501 2012 0 1 0 . |
3159. | 100113550239501 2013 0 1 0 . |
3160. | 100113550239501 2014 0 1 0 . |
3161. | 100113550239501 2015 0 1 0 . |
|---------------------------------------------------------------------|
3162. | 100113550239501 2016 1 1 1 10.19484 |

is firm that was acquired in 2016

My concerns are how to
  1. Tell Stata to recognize firms that change ownership and the year acquisition happens, and accordingly calculate tfp difference matched pair of firms in the acquisition year
  2. The command that Stata use in the example of teffects does not work in this case, because it is used for cross-section data rather than panel data. For example, for my research, the following command would not work (matching based on emp as the number of employees and tang_as as tangible assets of the firm)
.teffects psmatch (tfp) (emp tang_as, logit), atet

How would I code in this case?

I would be grateful for your comments and suggestions. Thank you so much in advance!

Best regards,

Han Vuong Dieu.