Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Reshape data

    Hello members,

    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?

  • #2
    We can't see what you tried with reshape, but this is a standard problem within the scope of documented options,

    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
    
    reshape long @priceindex @totreturnind, i(date) j(indicator) string 
    
    gen dailydate = daily(date, "DMY")
    format dailydate %td 
    
    sort indicator dailydate 
    
    list, sepby(indicator)  
    
         +---------------------------------------------------------------------+
         |       date              indicator   totret~d   pricei~x   dailydate |
         |---------------------------------------------------------------------|
      1. | 30-12-1994   constellationbrandsa      255.2      255.2   30dec1994 |
      2. | 02-01-1995   constellationbrandsa      255.2      255.2   02jan1995 |
      3. | 03-01-1995   constellationbrandsa      248.9      248.9   03jan1995 |
      4. | 04-01-1995   constellationbrandsa     245.12      245.1   04jan1995 |
      5. | 05-01-1995   constellationbrandsa     245.96        246   05jan1995 |
      6. | 06-01-1995   constellationbrandsa     250.16      250.2   06jan1995 |
      7. | 09-01-1995   constellationbrandsa        251        251   09jan1995 |
      8. | 10-01-1995   constellationbrandsa     256.88      256.9   10jan1995 |
      9. | 11-01-1995   constellationbrandsa     258.56      258.6   11jan1995 |
     10. | 12-01-1995   constellationbrandsa     269.47      269.5   12jan1995 |
     11. | 13-01-1995   constellationbrandsa     251.84      251.8   13jan1995 |
     12. | 16-01-1995   constellationbrandsa     257.72      257.7   16jan1995 |
     13. | 17-01-1995   constellationbrandsa     257.72      257.7   17jan1995 |
     14. | 18-01-1995   constellationbrandsa     253.52      253.5   18jan1995 |
     15. | 19-01-1995   constellationbrandsa     253.52      253.5   19jan1995 |
     16. | 20-01-1995   constellationbrandsa     250.16      250.2   20jan1995 |
     17. | 23-01-1995   constellationbrandsa      246.8      246.8   23jan1995 |
     18. | 24-01-1995   constellationbrandsa     250.16      250.2   24jan1995 |
     19. | 25-01-1995   constellationbrandsa      246.8      246.8   25jan1995 |
     20. | 26-01-1995   constellationbrandsa     248.48      248.5   26jan1995 |
     21. | 27-01-1995   constellationbrandsa      246.8      246.8   27jan1995 |
     22. | 30-01-1995   constellationbrandsa     247.64      247.6   30jan1995 |
     23. | 31-01-1995   constellationbrandsa     245.12      245.1   31jan1995 |
     24. | 01-02-1995   constellationbrandsa     248.48      248.5   01feb1995 |
     25. | 02-02-1995   constellationbrandsa     249.32      249.3   02feb1995 |
     26. | 03-02-1995   constellationbrandsa     249.32      249.3   03feb1995 |
     27. | 06-02-1995   constellationbrandsa     249.32      249.3   06feb1995 |
     28. | 07-02-1995   constellationbrandsa     249.32      249.3   07feb1995 |
     29. | 08-02-1995   constellationbrandsa     253.52      253.5   08feb1995 |
     30. | 09-02-1995   constellationbrandsa     256.88      256.9   09feb1995 |
     31. | 10-02-1995   constellationbrandsa     258.56      258.6   10feb1995 |
     32. | 13-02-1995   constellationbrandsa     258.56      258.6   13feb1995 |
     33. | 14-02-1995   constellationbrandsa     251.84      251.8   14feb1995 |
     34. | 15-02-1995   constellationbrandsa     250.16      250.2   15feb1995 |
     35. | 16-02-1995   constellationbrandsa     248.48      248.5   16feb1995 |
     36. | 17-02-1995   constellationbrandsa     243.45      243.4   17feb1995 |
     37. | 20-02-1995   constellationbrandsa     243.45      243.4   20feb1995 |
     38. | 21-02-1995   constellationbrandsa     236.73      236.7   21feb1995 |
     39. | 22-02-1995   constellationbrandsa     245.12      245.1   22feb1995 |
     40. | 23-02-1995   constellationbrandsa     245.12      245.1   23feb1995 |
     41. | 24-02-1995   constellationbrandsa     250.16      250.2   24feb1995 |
     42. | 27-02-1995   constellationbrandsa      246.8      246.8   27feb1995 |
     43. | 28-02-1995   constellationbrandsa      248.9      248.9   28feb1995 |
     44. | 01-03-1995   constellationbrandsa     248.48      248.5   01mar1995 |
     45. | 02-03-1995   constellationbrandsa     245.12      245.1   02mar1995 |
     46. | 03-03-1995   constellationbrandsa     253.52      253.5   03mar1995 |
     47. | 06-03-1995   constellationbrandsa        251        251   06mar1995 |
     48. | 07-03-1995   constellationbrandsa     247.64      247.6   07mar1995 |
     49. | 08-03-1995   constellationbrandsa     250.16      250.2   08mar1995 |
     50. | 09-03-1995   constellationbrandsa     243.45      243.4   09mar1995 |
     51. | 10-03-1995   constellationbrandsa     245.12      245.1   10mar1995 |
     52. | 13-03-1995   constellationbrandsa     243.45      243.4   13mar1995 |
     53. | 14-03-1995   constellationbrandsa     235.47      235.5   14mar1995 |
     54. | 15-03-1995   constellationbrandsa     232.53      232.5   15mar1995 |
     55. | 16-03-1995   constellationbrandsa     241.77      241.8   16mar1995 |
     56. | 17-03-1995   constellationbrandsa     241.77      241.8   17mar1995 |
     57. | 20-03-1995   constellationbrandsa     243.45      243.4   20mar1995 |
     58. | 21-03-1995   constellationbrandsa     234.21      234.2   21mar1995 |
     59. | 22-03-1995   constellationbrandsa     240.09      240.1   22mar1995 |
     60. | 23-03-1995   constellationbrandsa     253.52      253.5   23mar1995 |
     61. | 24-03-1995   constellationbrandsa     270.31      270.3   24mar1995 |
     62. | 27-03-1995   constellationbrandsa     285.42      285.4   27mar1995 |
     63. | 28-03-1995   constellationbrandsa     287.94      287.9   28mar1995 |
     64. | 29-03-1995   constellationbrandsa     277.02        277   29mar1995 |
     65. | 30-03-1995   constellationbrandsa     281.22      281.2   30mar1995 |
     66. | 31-03-1995   constellationbrandsa     282.06      282.1   31mar1995 |
         |---------------------------------------------------------------------|
     67. | 30-12-1994                 ecolab     377.93      199.4   30dec1994 |
     68. | 02-01-1995                 ecolab     377.93      199.4   02jan1995 |
     69. | 03-01-1995                 ecolab      373.4        197   03jan1995 |
     70. | 04-01-1995                 ecolab     368.87      194.6   04jan1995 |
     71. | 05-01-1995                 ecolab     375.66      198.2   05jan1995 |
     72. | 06-01-1995                 ecolab     375.66      198.2   06jan1995 |
     73. | 09-01-1995                 ecolab     380.19      200.6   09jan1995 |
     74. | 10-01-1995                 ecolab     371.14      195.8   10jan1995 |
     75. | 11-01-1995                 ecolab     375.66      198.2   11jan1995 |
     76. | 12-01-1995                 ecolab     375.66      198.2   12jan1995 |
     77. | 13-01-1995                 ecolab     377.93      199.4   13jan1995 |
     78. | 16-01-1995                 ecolab     375.66      198.2   16jan1995 |
     79. | 17-01-1995                 ecolab     377.93      199.4   17jan1995 |
     80. | 18-01-1995                 ecolab     380.19      200.6   18jan1995 |
     81. | 19-01-1995                 ecolab     384.72        203   19jan1995 |
     82. | 20-01-1995                 ecolab     398.29      210.1   20jan1995 |
     83. | 23-01-1995                 ecolab     405.08      213.7   23jan1995 |
     84. | 24-01-1995                 ecolab     400.56      211.3   24jan1995 |
     85. | 25-01-1995                 ecolab     407.35      214.9   25jan1995 |
     86. | 26-01-1995                 ecolab     400.56      211.3   26jan1995 |
     87. | 27-01-1995                 ecolab     405.08      213.7   27jan1995 |
     88. | 30-01-1995                 ecolab     409.61      216.1   30jan1995 |
     89. | 31-01-1995                 ecolab     402.82      212.5   31jan1995 |
     90. | 01-02-1995                 ecolab     398.29      210.1   01feb1995 |
     91. | 02-02-1995                 ecolab     405.08      213.7   02feb1995 |
     92. | 03-02-1995                 ecolab     400.56      211.3   03feb1995 |
     93. | 06-02-1995                 ecolab     402.82      212.5   06feb1995 |
     94. | 07-02-1995                 ecolab     405.08      213.7   07feb1995 |
     95. | 08-02-1995                 ecolab     398.29      210.1   08feb1995 |
     96. | 09-02-1995                 ecolab     400.56      211.3   09feb1995 |
     97. | 10-02-1995                 ecolab     398.29      210.1   10feb1995 |
     98. | 13-02-1995                 ecolab     400.56      211.3   13feb1995 |
     99. | 14-02-1995                 ecolab     398.29      210.1   14feb1995 |
    100. | 15-02-1995                 ecolab     407.35      214.9   15feb1995 |
    101. | 16-02-1995                 ecolab      401.4      211.8   16feb1995 |
    102. | 17-02-1995                 ecolab     407.35      214.9   17feb1995 |
    103. | 20-02-1995                 ecolab     407.35      214.9   20feb1995 |
    104. | 21-02-1995                 ecolab     405.08      213.7   21feb1995 |
    105. | 22-02-1995                 ecolab     409.61      216.1   22feb1995 |
    106. | 23-02-1995                 ecolab     400.56      211.3   23feb1995 |
    107. | 24-02-1995                 ecolab     407.35      214.9   24feb1995 |
    108. | 27-02-1995                 ecolab     400.56      211.3   27feb1995 |
    109. | 28-02-1995                 ecolab     418.66      220.9   28feb1995 |
    110. | 01-03-1995                 ecolab     418.66      220.9   01mar1995 |
    111. | 02-03-1995                 ecolab     411.87      217.3   02mar1995 |
    112. | 03-03-1995                 ecolab     418.66      220.9   03mar1995 |
    113. | 06-03-1995                 ecolab     425.45      224.5   06mar1995 |
    114. | 07-03-1995                 ecolab     414.13      218.5   07mar1995 |
    115. | 08-03-1995                 ecolab     432.24      226.9   08mar1995 |
    116. | 09-03-1995                 ecolab     420.86      220.9   09mar1995 |
    117. | 10-03-1995                 ecolab     425.41      223.3   10mar1995 |
    118. | 13-03-1995                 ecolab     432.24      226.9   13mar1995 |
    119. | 14-03-1995                 ecolab     432.24      226.9   14mar1995 |
    120. | 15-03-1995                 ecolab     432.24      226.9   15mar1995 |
    121. | 16-03-1995                 ecolab     429.96      225.7   16mar1995 |
    122. | 17-03-1995                 ecolab     425.41      223.3   17mar1995 |
    123. | 20-03-1995                 ecolab     427.69      224.5   20mar1995 |
    124. | 21-03-1995                 ecolab     425.41      223.3   21mar1995 |
    125. | 22-03-1995                 ecolab     429.96      225.7   22mar1995 |
    126. | 23-03-1995                 ecolab     436.79      229.3   23mar1995 |
    127. | 24-03-1995                 ecolab     450.44      236.4   24mar1995 |
    128. | 27-03-1995                 ecolab     445.89        234   27mar1995 |
    129. | 28-03-1995                 ecolab     443.61      232.8   28mar1995 |
    130. | 29-03-1995                 ecolab     450.44      236.4   29mar1995 |
    131. | 30-03-1995                 ecolab     448.16      235.2   30mar1995 |
    132. | 31-03-1995                 ecolab     441.34      231.6   31mar1995 |
         |---------------------------------------------------------------------|
    133. | 30-12-1994        electricgastech      72.86       72.9   30dec1994 |
    134. | 02-01-1995        electricgastech      72.86       72.9   02jan1995 |
    135. | 03-01-1995        electricgastech      72.86       72.9   03jan1995 |
    136. | 04-01-1995        electricgastech      72.86       72.9   04jan1995 |
    137. | 05-01-1995        electricgastech      64.29       64.3   05jan1995 |
    138. | 06-01-1995        electricgastech      64.29       64.3   06jan1995 |
    139. | 09-01-1995        electricgastech      64.29       64.3   09jan1995 |
    140. | 10-01-1995        electricgastech      77.14       77.1   10jan1995 |
    141. | 11-01-1995        electricgastech      77.14       77.1   11jan1995 |
    142. | 12-01-1995        electricgastech      72.86       72.9   12jan1995 |
    143. | 13-01-1995        electricgastech      77.14       77.1   13jan1995 |
    144. | 16-01-1995        electricgastech      68.57       68.6   16jan1995 |
    145. | 17-01-1995        electricgastech      68.57       68.6   17jan1995 |
    146. | 18-01-1995        electricgastech      81.43       81.4   18jan1995 |
    147. | 19-01-1995        electricgastech      83.57       83.6   19jan1995 |
    148. | 20-01-1995        electricgastech      83.57       83.6   20jan1995 |
    149. | 23-01-1995        electricgastech      85.71       85.7   23jan1995 |
    150. | 24-01-1995        electricgastech      81.43       81.4   24jan1995 |
    151. | 25-01-1995        electricgastech      83.57       83.6   25jan1995 |
    152. | 26-01-1995        electricgastech      79.29       79.3   26jan1995 |
    153. | 27-01-1995        electricgastech      81.43       81.4   27jan1995 |
    154. | 30-01-1995        electricgastech      83.57       83.6   30jan1995 |
    155. | 31-01-1995        electricgastech      79.29       79.3   31jan1995 |
    156. | 01-02-1995        electricgastech      77.14       77.1   01feb1995 |
    157. | 02-02-1995        electricgastech      77.14       77.1   02feb1995 |
    158. | 03-02-1995        electricgastech      83.57       83.6   03feb1995 |
    159. | 06-02-1995        electricgastech      72.86       72.9   06feb1995 |
    160. | 07-02-1995        electricgastech      77.14       77.1   07feb1995 |
    161. | 08-02-1995        electricgastech      85.71       85.7   08feb1995 |
    162. | 09-02-1995        electricgastech         90         90   09feb1995 |
    163. | 10-02-1995        electricgastech         90         90   10feb1995 |
    164. | 13-02-1995        electricgastech      85.71       85.7   13feb1995 |
    165. | 14-02-1995        electricgastech      98.57       98.6   14feb1995 |
    166. | 15-02-1995        electricgastech      94.29       94.3   15feb1995 |
    167. | 16-02-1995        electricgastech     107.14      107.1   16feb1995 |
    168. | 17-02-1995        electricgastech      94.29       94.3   17feb1995 |
    169. | 20-02-1995        electricgastech      94.29       94.3   20feb1995 |
    170. | 21-02-1995        electricgastech      98.57       98.6   21feb1995 |
    171. | 22-02-1995        electricgastech      92.14       92.1   22feb1995 |
    172. | 23-02-1995        electricgastech     100.71      100.7   23feb1995 |
    173. | 24-02-1995        electricgastech      92.14       92.1   24feb1995 |
    174. | 27-02-1995        electricgastech      92.14       92.1   27feb1995 |
    175. | 28-02-1995        electricgastech      92.14       92.1   28feb1995 |
    176. | 01-03-1995        electricgastech      92.14       92.1   01mar1995 |
    177. | 02-03-1995        electricgastech      98.57       98.6   02mar1995 |
    178. | 03-03-1995        electricgastech         90         90   03mar1995 |
    179. | 06-03-1995        electricgastech         90         90   06mar1995 |
    180. | 07-03-1995        electricgastech      92.14       92.1   07mar1995 |
    181. | 08-03-1995        electricgastech      94.29       94.3   08mar1995 |
    182. | 09-03-1995        electricgastech      95.36       95.4   09mar1995 |
    183. | 10-03-1995        electricgastech     102.86      102.9   10mar1995 |
    184. | 13-03-1995        electricgastech      94.29       94.3   13mar1995 |
    185. | 14-03-1995        electricgastech        105        105   14mar1995 |
    186. | 15-03-1995        electricgastech        105        105   15mar1995 |
    187. | 16-03-1995        electricgastech        105        105   16mar1995 |
    188. | 17-03-1995        electricgastech     102.86      102.9   17mar1995 |
    189. | 20-03-1995        electricgastech     102.86      102.9   20mar1995 |
    190. | 21-03-1995        electricgastech     107.14      107.1   21mar1995 |
    191. | 22-03-1995        electricgastech     107.14      107.1   22mar1995 |
    192. | 23-03-1995        electricgastech     102.86      102.9   23mar1995 |
    193. | 24-03-1995        electricgastech     115.71      115.7   24mar1995 |
    194. | 27-03-1995        electricgastech        105        105   27mar1995 |
    195. | 28-03-1995        electricgastech        105        105   28mar1995 |
    196. | 29-03-1995        electricgastech     109.29      109.3   29mar1995 |
    197. | 30-03-1995        electricgastech     102.86      102.9   30mar1995 |
    198. | 31-03-1995        electricgastech        105        105   31mar1995 |
         +---------------------------------------------------------------------+
    .
    The code shows one extra step that is essential for anything serious, creation of a numeric daily date variable. Beyond that, it's evident that you have data only for weekdays, and indeed I guess only for trading days, so that needs attention.

    Comment


    • #3
      Again, thank you, Nick, for your help.

      Yes, I had the command to generate dailydate.

      Comment

      Working...
      X