Dear Stata users
I have a dataset where column headers are dates. For each date there stocks which are in a portfolio for a particular date.
When I try to import data into Stata dates convert into letters (A,B, C...etc).
I need to do two things:
1. Keep dates as column headers.
2. Reshape data into panel format. I used to use the following code: reshape long var (in my case should be date), i (I do not really have this variable).
Any thought how to implement it?
Thanks a lot in advance.
I have a dataset where column headers are dates. For each date there stocks which are in a portfolio for a particular date.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str12(A B C D) "KR7001511005" "KR7025830001" "KR7001380005" "KR7033250002" "KR7074610007" "KR7018500009" "KR7033250002" "KR7007160005" "KR7011780004" "KR7001250000" "KR7001250000" "KR7003961000" "KR7011781002" "KR7001380005" "KR7009380007" "KR7001250000" end
I need to do two things:
1. Keep dates as column headers.
2. Reshape data into panel format. I used to use the following code: reshape long var (in my case should be date), i (I do not really have this variable).
Any thought how to implement it?
Thanks a lot in advance.
Comment