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
Matching variables from two columnsHi, everyone! I have two columns with dummy variables, each '0' and '1'. And I want to merge these …
difference in combinationsyear combination price 2015 1 0.5 2016 1 1 2015 2 2 2016 2 2.5 2015 3 1 2016 3 1.5 Hey …
create a dummy pair of countriesHi, how can I create a dummy variable for each Partner if my observations are pairs of countries li…
merging panel data - merge or joinby?hello! I am looking to merge two datasets to end with coherent district-level daily dataset from 200…
Network meta-analysisHello. I have the following data set. I get the 'variables study_id treatment do not uniquely identi…
Subscribe to:
Post Comments (Atom)
0 Response to Counting number of specific observations per group
Post a Comment