Hello all

I am looking into how the number of times a person migrates affects their change in happiness levels.

My question is that I have a dummy variable that shows when a person migrates ( 1 if they move in that year) but I don’t know how to have a variable that adds onto previous occurrences of this dummy variable showing 1. For example, when the person has already migrated once, there will be a variable to show that this is the second time of moving and so on for multiple migrations.

I am using 15.

Thanks in advance