Hi all,

I have a dataset of 7000 employees divided over 600 companies. I want to assess the impact of a certain policy on the pay gap between men and women. I want to do this with twin fixed effects, by taking company1 as twin1 and company 2 as twin 2 and so on. I just have some trouble pairing them up. is there a command for this? and how do I restrict my dataset to twins?

I know I have to collapse the data, I just can't figure out how.

example of data:
Array