Dear Stata user
I would like to ask about how to stack daily stock price data.
I have use command
"stack TLKMIJEquity HMSPIJEquity"
but the result is not like I intended, because I lost the variable date.
The table below is my data
and below is table that I want to generate:
Thank you in advance for any help
Anzas
I would like to ask about how to stack daily stock price data.
I have use command
"stack TLKMIJEquity HMSPIJEquity"
but the result is not like I intended, because I lost the variable date.
The table below is my data
DATE | TLKM IJ Equity | HMSP IJ Equity |
04/01/2000 | 0.089167945 | 0.048009219 |
05/01/2000 | -0.063591103 | -0.048009219 |
06/01/2000 | 0.029852963 | 0.016260521 |
07/01/2000 | 0 | 0 |
10/01/2000 | 0 | 0 |
11/01/2000 | 0.014598799 | -0.016260521 |
12/01/2000 | -0.014598799 | -0.016529302 |
13/01/2000 | 0.004889985 | 0.016529302 |
14/01/2000 | 0.019324273 | 0.032260862 |
17/01/2000 | 0.009523882 | 0.090971778 |
18/01/2000 | -0.01913934 | -0.075223421 |
and below is table that I want to generate:
date | company_name | stockprice |
04/01/2000 | TLKM IJ Equity | 0.089167945 |
05/01/2000 | TLKM IJ Equity | -0.063591103 |
06/01/2000 | TLKM IJ Equity | 0.029852963 |
07/01/2000 | TLKM IJ Equity | 0 |
10/01/2000 | TLKM IJ Equity | 0 |
11/01/2000 | TLKM IJ Equity | 0.014598799 |
12/01/2000 | TLKM IJ Equity | -0.014598799 |
13/01/2000 | TLKM IJ Equity | 0.004889985 |
14/01/2000 | TLKM IJ Equity | 0.019324273 |
17/01/2000 | TLKM IJ Equity | 0.009523882 |
18/01/2000 | TLKM IJ Equity | -0.01913934 |
04/01/2000 | HMSP IJ Equity | 0.048009219 |
05/01/2000 | HMSP IJ Equity | -0.048009219 |
06/01/2000 | HMSP IJ Equity | 0.016260521 |
07/01/2000 | HMSP IJ Equity | 0 |
10/01/2000 | HMSP IJ Equity | 0 |
11/01/2000 | HMSP IJ Equity | -0.016260521 |
12/01/2000 | HMSP IJ Equity | -0.016529302 |
13/01/2000 | HMSP IJ Equity | 0.016529302 |
14/01/2000 | HMSP IJ Equity | 0.032260862 |
17/01/2000 | HMSP IJ Equity | 0.090971778 |
18/01/2000 | HMSP IJ Equity | -0.075223421 |
Anzas
Comment