Dear all,
I am quite new to Stata and still struggling with some commands.
My dataset contains information on workers and their workplace: most workers are observed in the years 1990-1997. For each observation, I have a worker_id and a firm_id: some of the workers changed their workplace over the years. I have a dummy variable identifying those workers and the id of the firm they previously worked in. I am trying to build a measure of their network, as given by the number of coworkers in their previous workplace.
Is there a way to count the observations whose firm_id is identical to the previous_firm_id that the job-switching observations have and whose year is antecedent to the one of the switch? It seems to me that some kind of loop must be created, but I haven't been able to find a way yet.
Thank you, any help would be much appreciated.
Gioia
I am quite new to Stata and still struggling with some commands.
My dataset contains information on workers and their workplace: most workers are observed in the years 1990-1997. For each observation, I have a worker_id and a firm_id: some of the workers changed their workplace over the years. I have a dummy variable identifying those workers and the id of the firm they previously worked in. I am trying to build a measure of their network, as given by the number of coworkers in their previous workplace.
Is there a way to count the observations whose firm_id is identical to the previous_firm_id that the job-switching observations have and whose year is antecedent to the one of the switch? It seems to me that some kind of loop must be created, but I haven't been able to find a way yet.
Thank you, any help would be much appreciated.
Gioia
Comment