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
Estimate incidence rate (looping)Hello all, I currently have the dataset below. I want to calculate the incidence rate for each mont…
Can you help me write Two-step system GMM command ?Hello everyone, to not take from ure time much, im trying to run Two-step system GMM and i dont kno…
? = number of redundant parameters may be higherI used the command "reghdfe", and when i absorb three different fixed effect, stata told me "? = num…
How to change label position with coeffplot ?Good morning everyone, I have the following code that plots my coefficient : Code: coefplot /// (…
foreach loop error r(100) using requiredHello I am new to Stata and I am trying to write a foreach loop code, My code is use "/Users/elenac…
Subscribe to:
Post Comments (Atom)
0 Response to Number of IDs per group
Post a Comment