Hello,
The data I am working with on Stata is financial stock data between the years of 2012-2017. I have created an ID variable for the position holder (there are around 300 unique position holders). Each position holder has holdings in more than one stock. Due to this, there are instances where the position holders trade multiple stocks in one day. In order to declare panel data, I created a unique ID for each position holder + stock holding. Therefore each panel is a unique position holders' transaction history in one stock between 2012-2017.
I have generated a PaperGain variable, which generates the value 1 if the stock is either sold for profit or could be sold for profit on that particular day (either traded or it could have been traded for gain). I would like to sum this PaperGain value for each date a stock is transacted for each position holder in every stock they own. This is because there may be multiple PaperGain's on a certain day that the position holder owns, and so I would like to sum this altogether. Is there a way to do this?
Regards
The data I am working with on Stata is financial stock data between the years of 2012-2017. I have created an ID variable for the position holder (there are around 300 unique position holders). Each position holder has holdings in more than one stock. Due to this, there are instances where the position holders trade multiple stocks in one day. In order to declare panel data, I created a unique ID for each position holder + stock holding. Therefore each panel is a unique position holders' transaction history in one stock between 2012-2017.
I have generated a PaperGain variable, which generates the value 1 if the stock is either sold for profit or could be sold for profit on that particular day (either traded or it could have been traded for gain). I would like to sum this PaperGain value for each date a stock is transacted for each position holder in every stock they own. This is because there may be multiple PaperGain's on a certain day that the position holder owns, and so I would like to sum this altogether. Is there a way to do this?
Regards
Comment