I have a data set of American companies over the period 1985-2015 with circa 300k observations of leverage-ratios. So every company has 30 observations.
For a figure I have to construct the average leverage ratios of four portfolios in 'event time' . So what I want to do is the following: each year, I sort firms into quartiles (creating four portfolios) according to their leverage-ratio. The portfolio is denoted event year 0 and I want to compute the average leverage for each portfolio in each of the following 20 years. I want to do this by creating portfolios for year=1985 and so on. How can I follow the different portfolios over the years and compute their average leverage-ratios?
To illustrate, from one year I can derive the 4 quartiles and their average leverage. The next step would be to isolate each quartile (each group of firms) and follow particular group and see how their average leverage develops over time. Can anyone help me with isolating a quartile and filtering the data in a way that you can observe the leverage of these firms in t+1, t+2, etc.
Please let me know if my issue is not clear.
Thanks in advance,
Koen van Hanegem
Related Posts with Following different portfolios over time
Remove accents on a string variable in stataDear everyone, I would like to know if someone knows a STATA code that I can use to remove accents …
Counting Instance of a variable and returning averageI am a student and new to Stata. Any help is appreciated. I have a data set with age and weight. I …
Why Stata doesn't recognize empty valuesHi, I have recently created a new variable mothergrad1 and there are empty values when I used the f…
Why the local value in a loop changes after use another data-set ?I have two datasets. The first one contains the following data. The data name is Forloop.dta. Code:…
Sum Variable in columsHello i have id Year temp "seq" 1 2001 . 0 1 2002 1 1 1 2003 1 2 1 2004 . 0 2 2001…
Subscribe to:
Post Comments (Atom)
0 Response to Following different portfolios over time
Post a Comment