Hello - thanks for this, I'm sorry if I wasn't clear in my original post but I have merged waves of data together but it is from that point where I would appreciate assistance in creating the derived variable as described. I am posting my current (partial) syntax below - if you could give me some guidance on this, I would be very grateful.
***********
FOR WAVE 10
gen j_ses5=.
replace j_ses5=j_jbnssec5 if j_jbnssec5!=. & j_jbnssec5>0
replace j_ses5=i_jbnssec5 if j_ses5==. & i_jbnssec5!=. & i_jbnssec5>0
replace j_ses5=h_jbnssec5 if j_ses5==. & h_jbnssec5!=. & h_jbnssec5>0
replace j_ses5=g_jbnssec5 if j_ses5==. & g_jbnssec5!=. & g_jbnssec5>0
replace j_ses5=f_jbnssec5 if j_ses5==. & f_jbnssec5!=. & f_jbnssec5>0
replace j_ses5=e_jbnssec5 if j_ses5==. & e_jbnssec5!=. & e_jbnssec5>0
replace j_ses5=d_jbnssec5 if j_ses5==. & d_jbnssec5!=. & d_jbnssec5>0
replace j_ses5=c_jbnssec5 if j_ses5==. & c_jbnssec5!=. & c_jbnssec5>0
replace j_ses5=b_jbnssec5 if j_ses5==. & b_jbnssec5!=. & b_jbnssec5>0
replace j_ses5=a_jbnssec5 if j_ses5==. & a_jbnssec5!=. & a_jbnssec5>0
replace j_ses5=j_jlnssec5 if j_ses5==. & j_jlnssec5!=. & j_jlnssec5>0
replace j_ses5=i_jlnssec5 if j_ses5==. & i_jlnssec5!=. & i_jlnssec5>0
replace j_ses5=h_jlnssec5 if j_ses5==. & h_jlnssec5!=. & h_jlnssec5>0
replace j_ses5=g_jlnssec5 if j_ses5==. & g_jlnssec5!=. & g_jlnssec5>0
replace j_ses5=f_jlnssec5 if j_ses5==. & f_jlnssec5!=. & f_jlnssec5>0
replace j_ses5=e_jlnssec5 if j_ses5==. & e_jlnssec5!=. & e_jlnssec5>0
replace j_ses5=d_jlnssec5 if j_ses5==. & d_jlnssec5!=. & d_jlnssec5>0
replace j_ses5=c_jlnssec5 if j_ses5==. & c_jlnssec5!=. & c_jlnssec5>0
replace j_ses5=b_jlnssec5 if j_ses5==. & b_jlnssec5!=. & b_jlnssec5>0
replace j_ses5=a_jlnssec5 if j_ses5==. & a_jlnssec5!=. & a_jlnssec5>0
FOR WAVE 9
gen i_ses5=.
replace i_ses5=i_jbnssec5 if i_jbnssec5!=. & i_jbnssec5>0
replace i_ses5=h_jbnssec5 if i_ses5==. & h_jbnssec5!=. & h_jbnssec5>0
replace i_ses5=g_jbnssec5 if i_ses5==. & g_jbnssec5!=. & g_jbnssec5>0
replace i_ses5=f_jbnssec5 if i_ses5==. & f_jbnssec5!=. & f_jbnssec5>0
replace i_ses5=e_jbnssec5 if i_ses5==. & e_jbnssec5!=. & e_jbnssec5>0
replace i_ses5=d_jbnssec5 if i_ses5==. & d_jbnssec5!=. & d_jbnssec5>0
replace i_ses5=c_jbnssec5 if i_ses5==. & c_jbnssec5!=. & c_jbnssec5>0
replace i_ses5=b_jbnssec5 if i_ses5==. & b_jbnssec5!=. & b_jbnssec5>0
replace i_ses5=a_jbnssec5 if i_ses5==. & a_jbnssec5!=. & a_jbnssec5>0
replace i_ses5=i_jlnssec5 if i_ses5==. & i_jlnssec5!=. & i_jlnssec5>0
replace i_ses5=h_jlnssec5 if i_ses5==. & h_jlnssec5!=. & h_jlnssec5>0
replace i_ses5=g_jlnssec5 if i_ses5==. & g_jlnssec5!=. & g_jlnssec5>0
replace i_ses5=f_jlnssec5 if i_ses5==. & f_jlnssec5!=. & f_jlnssec5>0
replace i_ses5=e_jlnssec5 if i_ses5==. & e_jlnssec5!=. & e_jlnssec5>0
replace i_ses5=d_jlnssec5 if i_ses5==. & d_jlnssec5!=. & d_jlnssec5>0
replace i_ses5=c_jlnssec5 if i_ses5==. & c_jlnssec5!=. & c_jlnssec5>0
replace i_ses5=b_jlnssec5 if i_ses5==. & b_jlnssec5!=. & b_jlnssec5>0
replace i_ses5=a_jlnssec5 if i_ses5==. & a_jlnssec5!=. & a_jlnssec5>0
ETC.
Best wishes,
Neil
Understanding Society User Support Team wrote in #note-1:
Hello,
To create this variable for those who were interviewed previously and currently not working, you will need to combine data from different waves. There are two ways to do this - in a wide format or in a long format. The Stata syntax for merging indresp data files in a wide and long format are here: https://www.understandingsociety.ac.uk/documentation/mainstage/syntax
Click on tab "UKHLS deposited syntax" and look for syntax files under the headers: "Merging individual files across waves into wide format" & "Merging individual files across waves into long format"
Hope this helps.
Best wishes,
Understanding Society User Support Team