Hi everyone, I have a database with workers (id) in firms (worker x id), their salary, the year of the observation, as well as a variable displaced equal to one if they will be displaced from the firm the year after (if displaced=1 in 2002, the worker is displaced from the firm in 2003. Displaced has been created based on the disappearance of the worker from the panel. The salary in 2003 at year t will be thus of 0). id firm x id displaced year salary Salary t-1 Salary t-2 1 12 0 2002 2000 . 1 12 1 2003 1500 2000 . 2 22 0 2002 560 . . 2 22 0 2003 580 . . 2 22 1 2004 600 580 560 I want to do a diff in diff regression over several years to estimate the effect of displacement on revenue. The problem is I want to take t (salary at displacement year) as the dependent variable of the regression, but also do the regression on passed years' salary to see the influence of displacement at year t on revenue at year t-1 for example. I thus have to create, for each individual displaced at year t with the salary t, a variable in the same row indicating the revenu in t-1, t-2, t-3 etc. Salary t-1 and Salary t-2 in the table above are the variables I look for. Do you know if it is at least possible to do something like this? I would be very grateful for help!!! Thank you in advance, Eugénie
... View more