Hello members,
I have the total return index and price index data downloaded from the Datastream for approximately 9000 companies:
I have to arrange the data in the following format
Date indicator totreturnind priceindex
"30-12-1994" ecolab 377.93 199.4
"02-01-1995" ecolab 377.93 199.4
"03-01-1995" ecolab 373.4 197
"04-01-1995" ecolab 368.87 194.6
"05-01-1995" ecolab 375.66 198.2
"30-12-1994" constellationbrandsa 255.2 255.2
"02-01-1995" constellationbrandsa 255.2 255.2
"03-01-1995" constellationbrandsa 248.9 248.9
"04-01-1995" constellationbrandsa 245.12 245.1
"05-01-1995" constellationbrandsa 245.96 246
Can anyone please help me with the reshape command?
I have the total return index and price index data downloaded from the Datastream for approximately 9000 companies:
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str10 date float(ecolabtotreturnind ecolabpriceindex constellationbrandsatotreturnind constellationbrandsapriceindex electricgastechtotreturnind electricgastechpriceindex) "30-12-1994" 377.93 199.4 255.2 255.2 72.86 72.9 "02-01-1995" 377.93 199.4 255.2 255.2 72.86 72.9 "03-01-1995" 373.4 197 248.9 248.9 72.86 72.9 "04-01-1995" 368.87 194.6 245.12 245.1 72.86 72.9 "05-01-1995" 375.66 198.2 245.96 246 64.29 64.3 "06-01-1995" 375.66 198.2 250.16 250.2 64.29 64.3 "09-01-1995" 380.19 200.6 251 251 64.29 64.3 "10-01-1995" 371.14 195.8 256.88 256.9 77.14 77.1 "11-01-1995" 375.66 198.2 258.56 258.6 77.14 77.1 "12-01-1995" 375.66 198.2 269.47 269.5 72.86 72.9 "13-01-1995" 377.93 199.4 251.84 251.8 77.14 77.1 "16-01-1995" 375.66 198.2 257.72 257.7 68.57 68.6 "17-01-1995" 377.93 199.4 257.72 257.7 68.57 68.6 "18-01-1995" 380.19 200.6 253.52 253.5 81.43 81.4 "19-01-1995" 384.72 203 253.52 253.5 83.57 83.6 "20-01-1995" 398.29 210.1 250.16 250.2 83.57 83.6 "23-01-1995" 405.08 213.7 246.8 246.8 85.71 85.7 "24-01-1995" 400.56 211.3 250.16 250.2 81.43 81.4 "25-01-1995" 407.35 214.9 246.8 246.8 83.57 83.6 "26-01-1995" 400.56 211.3 248.48 248.5 79.29 79.3 "27-01-1995" 405.08 213.7 246.8 246.8 81.43 81.4 "30-01-1995" 409.61 216.1 247.64 247.6 83.57 83.6 "31-01-1995" 402.82 212.5 245.12 245.1 79.29 79.3 "01-02-1995" 398.29 210.1 248.48 248.5 77.14 77.1 "02-02-1995" 405.08 213.7 249.32 249.3 77.14 77.1 "03-02-1995" 400.56 211.3 249.32 249.3 83.57 83.6 "06-02-1995" 402.82 212.5 249.32 249.3 72.86 72.9 "07-02-1995" 405.08 213.7 249.32 249.3 77.14 77.1 "08-02-1995" 398.29 210.1 253.52 253.5 85.71 85.7 "09-02-1995" 400.56 211.3 256.88 256.9 90 90 "10-02-1995" 398.29 210.1 258.56 258.6 90 90 "13-02-1995" 400.56 211.3 258.56 258.6 85.71 85.7 "14-02-1995" 398.29 210.1 251.84 251.8 98.57 98.6 "15-02-1995" 407.35 214.9 250.16 250.2 94.29 94.3 "16-02-1995" 401.4 211.8 248.48 248.5 107.14 107.1 "17-02-1995" 407.35 214.9 243.45 243.4 94.29 94.3 "20-02-1995" 407.35 214.9 243.45 243.4 94.29 94.3 "21-02-1995" 405.08 213.7 236.73 236.7 98.57 98.6 "22-02-1995" 409.61 216.1 245.12 245.1 92.14 92.1 "23-02-1995" 400.56 211.3 245.12 245.1 100.71 100.7 "24-02-1995" 407.35 214.9 250.16 250.2 92.14 92.1 "27-02-1995" 400.56 211.3 246.8 246.8 92.14 92.1 "28-02-1995" 418.66 220.9 248.9 248.9 92.14 92.1 "01-03-1995" 418.66 220.9 248.48 248.5 92.14 92.1 "02-03-1995" 411.87 217.3 245.12 245.1 98.57 98.6 "03-03-1995" 418.66 220.9 253.52 253.5 90 90 "06-03-1995" 425.45 224.5 251 251 90 90 "07-03-1995" 414.13 218.5 247.64 247.6 92.14 92.1 "08-03-1995" 432.24 226.9 250.16 250.2 94.29 94.3 "09-03-1995" 420.86 220.9 243.45 243.4 95.36 95.4 "10-03-1995" 425.41 223.3 245.12 245.1 102.86 102.9 "13-03-1995" 432.24 226.9 243.45 243.4 94.29 94.3 "14-03-1995" 432.24 226.9 235.47 235.5 105 105 "15-03-1995" 432.24 226.9 232.53 232.5 105 105 "16-03-1995" 429.96 225.7 241.77 241.8 105 105 "17-03-1995" 425.41 223.3 241.77 241.8 102.86 102.9 "20-03-1995" 427.69 224.5 243.45 243.4 102.86 102.9 "21-03-1995" 425.41 223.3 234.21 234.2 107.14 107.1 "22-03-1995" 429.96 225.7 240.09 240.1 107.14 107.1 "23-03-1995" 436.79 229.3 253.52 253.5 102.86 102.9 "24-03-1995" 450.44 236.4 270.31 270.3 115.71 115.7 "27-03-1995" 445.89 234 285.42 285.4 105 105 "28-03-1995" 443.61 232.8 287.94 287.9 105 105 "29-03-1995" 450.44 236.4 277.02 277 109.29 109.3 "30-03-1995" 448.16 235.2 281.22 281.2 102.86 102.9 "31-03-1995" 441.34 231.6 282.06 282.1 105 105 end
I have to arrange the data in the following format
Date indicator totreturnind priceindex
"30-12-1994" ecolab 377.93 199.4
"02-01-1995" ecolab 377.93 199.4
"03-01-1995" ecolab 373.4 197
"04-01-1995" ecolab 368.87 194.6
"05-01-1995" ecolab 375.66 198.2
"30-12-1994" constellationbrandsa 255.2 255.2
"02-01-1995" constellationbrandsa 255.2 255.2
"03-01-1995" constellationbrandsa 248.9 248.9
"04-01-1995" constellationbrandsa 245.12 245.1
"05-01-1995" constellationbrandsa 245.96 246
Can anyone please help me with the reshape command?
Comment