Hi all,
I am currently working on a stata dataset in regards to institutional holdings. I would like to count how many institutions hold a particular stock in one quarter. Below is an example of my database.
country mgrno ticker yq prc shares change
AUSTRALIA 8741 ACC 2016q1 47.09 435739
AUSTRALIA 8741 ACC 2016q2 52.87 704029
AUSTRALIA 8741 ACC 2016q3 50.87 725429
AUSTRALIA 8741 ACC 2016q4 49.77 842215
AUSTRALIA 8741 ACC 2017q1 47.59 724819
AUSTRALIA 8741 ACC 2017q2 47.3 480631
AUSTRALIA 8741 ACC 2017q3 44.15 459211
AUSTRALIA 8741 ACC 2017q4 41.03 448423
AUSTRALIA 8741 ACC 2018q1 38.62 646078
AUSTRALIA 8741 ACC 2018q2 42.88 636689
AUSTRALIA 8741 ACC 2018q3 41.16 362859
AUSTRALIA 8741 ACC 2018q4 41.39 903309
AUSTRALIA 8741 AKR 2011q4 20.14 538837 290637
AUSTRALIA 8741 AKR 2012q1 22.54 419013 170813
AUSTRALIA 8741 AKR 2012q2 23.18 116057 -132143
AUSTRALIA 8741 AKR 2012q3 24.82 169857 -78343
AUSTRALIA 8741 AKR 2012q4 25.08 172857 -75343
AUSTRALIA 8741 AKR 2013q1 27.77 154357 -93843
AUSTRALIA 8741 AKR 2013q2 25.14 164652 -83548
AUSTRALIA 8741 AKR 2014q3 27.58 936377 688177
AUSTRALIA 8741 AKR 2014q4 32.03 1122871 874671
AUSTRALIA 8741 AKR 2015q1 34.88 775055 526855
AUSTRALIA 8741 AKR 2015q2 29.59 829421 581221
AUSTRALIA 8741 AKR 2015q4 33.15 749269 501069
AUSTRALIA 8741 AKR 2016q1 35.13 1200440 952240
AUSTRALIA 8741 AKR 2016q2 35.52 1264233 1016033
AUSTRALIA 8741 AKR 2016q3 36.24 1302733 1054533
AUSTRALIA 8741 AKR 2016q4 32.68 883462 635262
In this case, I would like to count how many institutions, by mgrno, hold stock, for example, "ACC" in 2016q1. I would like to be able to cover all stocks of all quarters in the dataset.
Thank you very much!
Related Posts with Generating Variable Based on Multiple Conditions
Importing CSV file with surrounding single quotesI'm attempting to import data in a CSV file, where almost all variable values are surrounded by sing…
T-Test between two varibles with dummy conditionHey, I woul like to know how I could do the t-test between 2 variables if I calculated the mean with…
Combining locals that contain whitespaceI have a series of locals of the form: Code: local list1 "June 2004" local list2 "July 2004" …
Combining plots in StataDear all, I wonder if anyone knows how to combine plots in Stata, considering a case when both figur…
Panel data of M&A's and patenting activityHello, I have a question that is a bit general, but hopefully somebody can help me since I’m quite …
Subscribe to:
Post Comments (Atom)
0 Response to Generating Variable Based on Multiple Conditions
Post a Comment