I have been trying to import daily time series data through Datastream/Excel. As Datastream sorts the data differently, I have been trying to use the reshape function accoding to this blog post: https://researchfinancial.wordpress....am-data-stata/. However, this post concerns an older version of Stata (while I am using Stata 15) and is using monthly data, whereas I need to use daily data. I have added a letter to the dates, like shown in the blog post. My excel file therefore looks as follows.

I am trying to sort the data by ISIN (the company code) in the first column and then add the dates (a period of 11 days) for each company, so that the values in this file are shown per company and date. The commands I have used are the following: import excel "D:\Data\A+D.xlsx", sheet("Price1") firstrow allstring and reshape long D, i(ISIN) j(dag).
The imported data, before reshape, looks like this:

after reshape long D, i(ISIN) j(dag), it looks like this:

So the dates are now included in the rows and the columns (sort of) and apparently I have managed to let Stata believe that the dates are normal numeric values. I have also tried importing the data from excel with a different notation for the dates, namely D13nov2013 and 13nov2013. However, using these other notations, the data was either imported wrongly or the reshape command resulted in error r(498) "variable dag contains all missing values".
I hope I have provided enough information to make my situation clear. Thank you in advance.
I am trying to sort the data by ISIN (the company code) in the first column and then add the dates (a period of 11 days) for each company, so that the values in this file are shown per company and date. The commands I have used are the following: import excel "D:\Data\A+D.xlsx", sheet("Price1") firstrow allstring and reshape long D, i(ISIN) j(dag).
The imported data, before reshape, looks like this:
after reshape long D, i(ISIN) j(dag), it looks like this:
So the dates are now included in the rows and the columns (sort of) and apparently I have managed to let Stata believe that the dates are normal numeric values. I have also tried importing the data from excel with a different notation for the dates, namely D13nov2013 and 13nov2013. However, using these other notations, the data was either imported wrongly or the reshape command resulted in error r(498) "variable dag contains all missing values".
I hope I have provided enough information to make my situation clear. Thank you in advance.
Comment