I am trying to generate a change score that captures changes in labour force participation. I have three survey waves. Using binary variable cremp2 (employment status, Yes/No) I run the following command:
Code:
bysort Findid (round): gen change = cremp2-cremp2[_n-1] recode change -1=2 label define chnnge 0 "No change" 1 "Unemployed - employed" 2 "employed - unemployed" label values change chnnge
No change
Unemployed – employed – unemployed
Employed – unemployed – unemployed
Unemployed – unemployed – employed
Employed – employed – unemployed
Unemployed – employed – employed
And so on – to basically captures all possible changes in LFP over the three waves. Do I understand this correctly?
Below is an example of my dataset, you can see the change variable produces two observations for each panel ID at T=2012 (change from 2006-2012) and T=2018 (change from 2012-2018). Whereas I am trying to produce one observation at T=2018 for each individual in my panel dataset (i.e. change from 2006 - 2012 - 2018)
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input double Findid byte(round cremp2_) float change 601002402 6 0 . 601002402 12 0 0 601002402 18 0 0 601004603 6 0 . 601004603 12 0 0 601004603 18 0 0 601005902 6 1 . 601005902 12 1 0 601005902 18 1 0 601011602 6 0 . 601011602 12 0 0 601011602 18 0 0 601012406 6 0 . 601012406 12 0 0 601012406 18 0 0 601019209 6 0 . 601019209 12 0 0 601019209 18 1 1 601020203 6 1 . 601020203 12 1 0 601020203 18 0 2 601024002 6 1 . 601024002 12 0 2 601024002 18 0 0 601025503 6 0 . 601025503 12 0 0 601025503 18 0 0 601025702 6 0 . 601025702 12 0 0 601025702 18 0 0 601030704 6 0 . 601030704 12 0 0 601030704 18 0 0 601031403 6 1 . 601031403 12 1 0 601031403 18 1 0 601032102 6 1 . 601032102 12 1 0 601032102 18 0 2 601032309 6 0 . 601032309 12 0 0 601032309 18 0 0 601033103 6 0 . 601033103 12 0 0 601033103 18 0 0 601036602 6 0 . 601036602 12 0 0 601036602 18 0 0 601037505 6 0 . 601037505 12 0 0 601037505 18 0 0 601038302 6 0 . 601038302 12 0 0 601038302 18 0 0 601045003 6 0 . 601045003 12 0 0 601045003 18 0 0 601048702 6 0 . 601048702 12 0 0 601048702 18 0 0 601050804 6 0 . 601050804 12 0 0 601050804 18 0 0 601051404 6 0 . 601051404 12 0 0 601051404 18 0 0 601054402 6 0 . 601054402 12 0 0 601054402 18 0 0 601055607 6 0 . 601055607 12 0 0 601055607 18 1 1 601056302 6 0 . 601056302 12 0 0 601056302 18 0 0 601058302 6 0 . 601058302 12 1 1 601058302 18 1 0 601058602 6 0 . 601058602 12 0 0 601058602 18 0 0 601059402 6 0 . 601059402 12 0 0 601059402 18 1 1 601060002 6 0 . 601060002 12 0 0 601060002 18 1 1 601060202 6 0 . 601060202 12 0 0 601060202 18 0 0 601060302 6 0 . 601060302 12 0 0 601060302 18 0 0 601061602 6 0 . 601061602 12 0 0 601061602 18 0 0 601061802 6 1 . 601061802 12 1 0 601061802 18 1 0 601062002 6 0 . end label values round year label def year 6 "2006", modify label def year 12 "2012", modify label def year 18 "2018", modify label values change chnnge label def chnnge 0 "No change", modify label def chnnge 1 "Unemployed - employed", modify label def chnnge 2 "employed - unemployed", modify
0 Response to Generating a change score variable
Post a Comment