Hey guys,

This is the data I have -

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input float piece_prod str15 variable str2 index
 5555.556 "roadside_market" "1" 
 3333.333 "roadside_market" "1" 
 7777.778 "broker"          "2" 
4444.4443 "broker"          "2" 
1111.1111 "Retailers"       "2" 
 1277.778 "broker"          "3" 
111.11111 "broker"          "3" 
1111.1111 "broker"          "4" 
1333.3334 "roadside_market" "5" 
 777.7778 "roadside_market" "5" 
1111.1111 "broker"          "6" 
 888.8889 "broker"          "6" 
 444.4445 "broker"          "6" 
 333.3333 "broker"          "6"
This is the code I used, but it didn't work -

Code:
reshape wide piece_prod, i(index) j(variable) string
How do I average piece_prod values when index and variable is same, so that I can finally reshape it?

​​​​​​​Thanks.