Hi, I want to reshape the following wide type of data to long type.
id c1 c2 c3
1 100 200 300
2 200 100 150
First I renamed them one by one:
Code:
 rename c1 asset90
id asset90 asset91 asset92
1 100 200 300
2 200 100 150
Then reshape from wide to long:
Code:
 reshape long asset  i(id) j(year)
id year asset
1 1990 100
1 1991 200
1 1992 300
2 1990 200
2 1991 100
2 1992 150
I want to rename all three variables c* into asset* using foreach loops (in case we have too many c* variables).
Could you help me with this?

And then I want to transform it from wide to long type (please let me know if there's a better way).


Thank you.