Hi all,
I have panel data with an identifier(ID) and a time variable(mofd, monthly). Based on a characteristic of the IDs, I have formed 10 portfolios. That means that each ID is sorted into a portfolio (1 to 10), every month. Now I am trying to find out how many IDs there are on average in the portfolios. Because the portfolios are formed every single month, in month T there might be 20 IDs in portfolio 1, and 22 in portfolio 2 (etc), but in month T+1 we might have 30 IDs in portfolio 1. So I am trying to find out how many there are on average in each portfolio.
I have heard about ssc unique and distinct, but both of these will only show me the number of distinct IDs per portfolio. I however want to repeat this exercise per portfolio per month, and then simply report the average.
Any ideas?
Thanks,
Erik
Related Posts with Number of IDs per group
Oaxaca decomposition detail unexplained partI am doing Oaxaca decomposition in detail. The interpretation of the explained part of different var…
Flipping (renaming) a stringHello, I have a series of varnames named year2010A | year2010B | ... | year2011A | year2011B | ... …
Interpreting turning poingHello, I have calculated the turning points of my models, but in one of them i first differenced som…
OLS R^2 for large datasets inaccurate (lassogof)Dear community, I am using 'lassogof' to compare the performance of different Lasso, Elastic Net an…
Race and age composition for 50 states in multiple yearsI'm working with ACS data where I'm gonna need state controls like - income per capita , unemploymen…
Subscribe to:
Post Comments (Atom)
0 Response to Number of IDs per group
Post a Comment