Dear all,
I have a simple problem for which I have not been able to find a solution. Imagine a very simple dataset regarding bank loans with three columns/variables. Variable 1 shows the distinct id variable for each loan in my sample. Variable 2 shows the lenders that were involved in making the loan (there can be multiple lenders per loan). Variable 3 shows the role of each lender for a specific loan (assume there can only be four roles: a,b,c,d).
How can I generate a new variable that shows me the number of banks with role b or c per loan?
Thanks in advance.
Regards, Ali
Related Posts with Counting number of specific observations per group
Ranking/categorizing firms based on the value of a variable in a specific yearHi I am working with a panel data set with c300 firms from years 2008 to 2014, with several firm-le…
Poisson with Robust SE showing totally different results from Log-OLS and NBHi, This is the first time I post question here. I've read pretty much all the posts on Poisson reg…
reghdfe dkraayI am having trouble with the syntax for reghdfe. I would like to run a regression using reghdfe that…
Generate a variable that counts ifHi all, my dataset looks something like this newid time_1 time_2 time_3 time_4 time_5 time_6 time_…
_all: in mixed models: What if it is followed by a continuous variable without the "R." part?Dear Statalist, I am trying to better understand how Stata deals with the _all: option in mixed/xtm…
Subscribe to:
Post Comments (Atom)
0 Response to Counting number of specific observations per group
Post a Comment