Dear all,
My longitudinal data variables are named as: s1dsrc s1relig s1bplacf where 1 goes from 1 to 12 (12 survey waves. 36 variables). Household identifier is hhid.
1. Can I use reshape directly to convert the data from wide to long?
2. If not, how to apply loop to change the variable names: s1dsrc to sdsrc1, s1relig to srelig1 and s1bplacf to sbplacf1 so that I could use another loop that does: reshape long sdsrc srelig bplacf, i(hhid) j(wave). where "wave" is new variable.
I really appreciate your helpful responses and time.
Best regards.
My longitudinal data variables are named as: s1dsrc s1relig s1bplacf where 1 goes from 1 to 12 (12 survey waves. 36 variables). Household identifier is hhid.
1. Can I use reshape directly to convert the data from wide to long?
2. If not, how to apply loop to change the variable names: s1dsrc to sdsrc1, s1relig to srelig1 and s1bplacf to sbplacf1 so that I could use another loop that does: reshape long sdsrc srelig bplacf, i(hhid) j(wave). where "wave" is new variable.
I really appreciate your helpful responses and time.
Best regards.
Comment