Hi there,
I'm working on a large dataset containing all stock trades from a large brokerage house. The variables are account number (hhnum), stock (cusip), date bought or sold (date), and quantity and price bought or sold. Below are the first couple of lines.
I have to omit some observations however for my analysis: Whenever an investor sells more of one stock over the period than he has bought over the period, all observations from that investor buying or selling that stock should be dropped (my analysis will include the average purchase price, and if more is sold than bought, I cannot calculate this).
Array
I'm fairly new to STATA and tried playing around with foreach, but so far haven't come up with anything that could do the job.
Could anyone point me in the right direction?
Philippe
Related Posts with Dropping certain stock trades from a large dataset
Question about cyclesBest users, For my thesis I'm partly using a paper by Shue and Townsend, that is on how stock optio…
conindex commandHi All, I am using concentration index for the first time and have no idea how to use it. My study …
Help needed: Mediation AnalysisHi guys, I could really use your help, I am very new with statistical analysis, however need to do a…
Counting events falling in any 5 year window around the focal eventHello everyone, I am working on a dataset containing a sample announcement dates (each standing for…
command qregpdHey all, I need help in understanding qregpd command introduced by powell2016. It has an instrument …
Subscribe to:
Post Comments (Atom)
0 Response to Dropping certain stock trades from a large dataset
Post a Comment