Hello Statlist community,
I have the following data that I would like to reshape to long:
Findid sex_98 age_98 qwealth_98 sex_06 age_06 qwealth_06
12345 Male 32 70 Male 40 50
I would like to reshape it so that it appears as follows
Findid year sex age qwealth
12345 1998 Male 32 70
12345 2006 Male 40 50
when I use the following code: reshape long sex age crempstp mnthwgAllJob yrschl crstablp crsectrp qwealth, i(Findid) j(year)
I get an error message saying that: "variable year contains all missing values"
I thought there was an issue with Stata trying to identify the year variable so created one, and when I tried reshaping the data from wide to long, I also got an error message saying that the data is already in long format even though it's not.
Do you have any idea what's wring and if so how I can fix it?
Thank you.
I have the following data that I would like to reshape to long:
Findid sex_98 age_98 qwealth_98 sex_06 age_06 qwealth_06
12345 Male 32 70 Male 40 50
I would like to reshape it so that it appears as follows
Findid year sex age qwealth
12345 1998 Male 32 70
12345 2006 Male 40 50
when I use the following code: reshape long sex age crempstp mnthwgAllJob yrschl crstablp crsectrp qwealth, i(Findid) j(year)
I get an error message saying that: "variable year contains all missing values"
I thought there was an issue with Stata trying to identify the year variable so created one, and when I tried reshaping the data from wide to long, I also got an error message saying that the data is already in long format even though it's not.
Do you have any idea what's wring and if so how I can fix it?
Thank you.
Comment