Dear Statalisters,

I’m working with panel data that contains observations for 8000 firms for the period 2006-2015. Some of these firms have received one (1) subsidy at different period of times. I’m interested in implement a Difference in Differences estimation. I have created the following variables:
A treatment binary variable 0,1 (VAR_SUB) that indicate if the firm have received a subsidy at some point of the time, i.e. the treatment occurs at multiple points of time.
A pre/post treatment binary variable, equal to 0 during the period previous to treatment and 1 from the year that firm obtain the subsidy. (VAR_PRE_POST)
My Outcome variable is also binary, equal 1 if firm engage in collaboration with centers of technology transfer and 0 otherwise (COLLABORATION).
I’m also including time trend variable, industry and different firm’s characteristics CONTROLS
My code is:

xtlogit COLLABORATION VAR_SUB##VAR_PRE CONTROLS, feHowever, I have the following problem, given that treatment occurs at different years for different firms, I can’t establish a pre-post treatment year for all the sample. I have read several threads at statalist about this topic like this https://www.statalist.org/forums/for...atment-periods or this https://www.statalist.org/forums/for...atment-periods, and they suggest to apply matching, in order to be able to create a pre/post treatment variable for firms at the control group. Is this possible in the context of panel data? How? I’ve tried with psmatch2 and it tend to use as control same firm observed in different years.
My second problem is. Assuming I am able to find the controls for my treated firms. How I can tell Stata that take into account only matched sample. I have read this could be done with the weights from matching routines (like psmatch2) or with the inverse of the propensity score, included as covariate. Again, I’m not sure how to put this in practice.