Dear All, I found this question here. The raw data is
Code:
* Example generated by -dataex-For more info, type help dataex
clear
input str3 id float(year A B)
"A" 2005  1  2
"B" 2005  3  4
"C" 2005  5  6
"A" 2006  7  8
"B" 2006  9 10
"C" 2006 11 12
end
The desired result is something like
Code:
* Example generated by -dataex-. For more info, type help dataex
clear
input str3 id float(year A B year2 A2 B2)
"A" 2005 1 2 2006  7  8
"B" 2005 3 4 2006  9 10
"C" 2005 5 6 2006 11 12
end
Any suggestions are appreciated.