Hi everyone, Im trying to use a panel dataset in stata but it does not have the right format yet. (see below for an example)
I want to join get the average price for every similar date per firm but the cumulative quantity for each firm per date.
I have search everywhere but cannot find a solution to this problem...
The aim of this is to be able to use this dataset as a panel in stata using: "xtset firmcode date" but as there is repetitive date for some individuals (firm) it doesn't work.
Does someone know how to do this or if it is possible?
In advance, I thank you for your help
Best regards,
Sybille
| Firm_code | Date | Quantity | Price |
| 1 | 24Dec2004 17:00:00 | 205 | 10 |
| 1 | 24Dec2004 17:00:00 | 300 | 5.3 |
| 1 | 24Dec2004 17:00:00 | 305 | 8 |
| 1 | 24Dec2004 19:00:00 | 67 | 8.2 |
| 2 | 24Dec2004 17:00:00 | 728 | 8 |
| 2 | 24Dec2004 19:00:00 | 72 | 3 |
| 3 | 25Dec2004 17:00:00 | 32 | 12 |
| .. | .. | .. | .. |
I have search everywhere but cannot find a solution to this problem...
The aim of this is to be able to use this dataset as a panel in stata using: "xtset firmcode date" but as there is repetitive date for some individuals (firm) it doesn't work.
Does someone know how to do this or if it is possible?
In advance, I thank you for your help
Best regards,
Sybille

Comment