Hello dear Statalist,
I am quite new with Stata and I could really need help for my thesis.
I have variables called "cusip" (firm code), "mgrno" (numerical code for investor (unique)), "rdate" (date), "typecode" (classification coding from 1-5 based on investor type), "shares" (number of shares held by each investor in a firm), and shrout2 (total shares for each firm in 1000).
However, some investors report their holdings multiple times a year (as can be seen from below), so if I would try to sum all the shares based on typecode for each firm, many would appear multiple times since they are reported quarterly. Not all however, so how can I do this? If I would like to get the total ownership for each type of investor for every firm for the latest date the ownership has been reported for example.
In the end, I would like to have a database of the ownership % (shares held by each type in each firm/total shares for firm) for each of the 5 investor types for each firm for that year.
Could someone help me?
When I tried dropping rdate duplicates based on mgrno and cusip, I lost necessary observations.
Array
Related Posts with Stata data manipulation filtering, summing and removing duplicates from quarterly observation data
In logistic, binary response variable works but if it has 3 categories then it doesn't work!I'm using a logistic reg for my survey data. In the main control variable, it has 3 categories. The …
Combining observations within the same datasetHello all, So I have an individual level dataset, in which the household id (hhid) is not unique, h…
Inquire about keeping variables temporarilyLet me state my question clearly. I currently have a dataset which has so many variables. (since thi…
float to string format error results in wrong values -- why?I need to create the fipscode for census tracts that were formatted incorrectly. The error occurs w…
xtpmg works in Stata 13/14 but not in 15/16?Dear All, I use (ssc install) xtpmg to estimate the following model. Code: * Example generated by -…
Subscribe to:
Post Comments (Atom)
0 Response to Stata data manipulation filtering, summing and removing duplicates from quarterly observation data
Post a Comment