Hi,
I need to run a t-test of volume variable in the following dataset on its lag having the same ticker value. I have defined n similar to following table as my timevar.
How could I run a test like ttest volume==l2.volume, while keeping the ticker code constant. In other word, I need to test whether the volume of each ticker is different from the lagged volume of the same ticker.
I appreciate your suggestions.
I need to run a t-test of volume variable in the following dataset on its lag having the same ticker value. I have defined n similar to following table as my timevar.
How could I run a test like ttest volume==l2.volume, while keeping the ticker code constant. In other word, I need to test whether the volume of each ticker is different from the lagged volume of the same ticker.
n | ticker | volume |
1 | aapl | 10 |
2 | aapl | 20 |
3 | aapl | 15 |
1 | spx | 25 |
2 | spx | 23 |
3 | spx | 15 |
1 | ibm | 10 |
2 | ibm | 15 |
3 | ibm | 20 |
Comment