For the below sample dataset, I would like to reshape the data to wide format such that there are three columns: date, C010000001 and C010010001. The last two columns will take values from the "value" column during the reshaping process. I further need to assign labels for C010000001 and C010010001 columns using the corresponding description values. So, the column "C010000001" should have the label "U.S. Reformulated Gasoline All Sales/Deliveries by Prime Supplier (Thousand Gallons per Day)" and "C010010001" the label "East Coast (PADD 1) Reformulated Gasoline All Sales/Deliveries by Prime Supplier (Thousand Gallons per Day)". Any help is appreciated.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str107(description series) double value float date "U.S. Reformulated Gasoline All Sales/Deliveries by Prime Supplier (Thousand Gallons per Day)" "C010000001" 111901 746 "East Coast (PADD 1) Reformulated Gasoline All Sales/Deliveries by Prime Supplier (Thousand Gallons per Day)" "C010010001" 42033.9 746 "U.S. Reformulated Gasoline All Sales/Deliveries by Prime Supplier (Thousand Gallons per Day)" "C010000001" 111079.1 745 "East Coast (PADD 1) Reformulated Gasoline All Sales/Deliveries by Prime Supplier (Thousand Gallons per Day)" "C010010001" 42331.7 745 "East Coast (PADD 1) Reformulated Gasoline All Sales/Deliveries by Prime Supplier (Thousand Gallons per Day)" "C010010001" 39600.2 744 "U.S. Reformulated Gasoline All Sales/Deliveries by Prime Supplier (Thousand Gallons per Day)" "C010000001" 104018 744 end format %tm date
Comment