Hello, so for my dissertation I want to analyse the impact of duration of unemployment on a person's BMI. To do this I need to code a variable that measures the number of years since a person lost their job.
I have panel data which includes a dummy variable in each wave showing if a person is employed (variable = 1) or unemployed (variable = 0). I want the new duration variable to show the number of waves since the employment variable changed from 1 to 0. So if employed currently equals 1 (i.e. they currently have a job) the duration equals zero. If employment equalled 1 in the previous wave and 0 in the current wave (they had a job in the last wave but have since lost it), duration should equal 1, etc.
The dataset has wave and unique identifier variables, but the dataset is too large to manually input the new variable. If anyone has any tips on how I could go about creating this variable I would be very grateful. I hope my definition of what I'm trying to create is clear, please let me know if there's any other details that would be useful to you.
I have panel data which includes a dummy variable in each wave showing if a person is employed (variable = 1) or unemployed (variable = 0). I want the new duration variable to show the number of waves since the employment variable changed from 1 to 0. So if employed currently equals 1 (i.e. they currently have a job) the duration equals zero. If employment equalled 1 in the previous wave and 0 in the current wave (they had a job in the last wave but have since lost it), duration should equal 1, etc.
The dataset has wave and unique identifier variables, but the dataset is too large to manually input the new variable. If anyone has any tips on how I could go about creating this variable I would be very grateful. I hope my definition of what I'm trying to create is clear, please let me know if there's any other details that would be useful to you.
Comment