Hi,

I have a dataset in long form with the variables country of origin, destination country, stock of female migrants from country I (origin) to destination (j), population_female, year, population origin country.
I want to create a new variable (dependent) which is the migration flow (=((stock of female migrants from i to j)- (stock of female migrants form i to j (t-1))/ (population female country i).
I don't know how to create this variable. Can someone help here?