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
Question about interactionI run regression and I would to show the interaction/difference between two variables. First, I use…
how to solve for a nonlinear equationHello, I'm looking for a way to solve this equation in Stata: 0.1(w+2000000)^(1-r) + 0.9(w-z)^(1-r…
combining three twoway kdensity grapghs togetherUsing the below codes, I could create three nice kdensity plots. I was wondering if there is any way…
Panel VECM post estimation or two-step replication with -pvar-Hi Statalists, I am fitting a panel VECM model with -xtpmg-. I am looking for the methods to conduc…
Adding F-Stat of first stage regression using ivreghdfe and estoutMy code is the following Code: eststo: ivreghdfe y (x=z), a(Year) first savefirst savefprefix(st1)…
Subscribe to:
Post Comments (Atom)
0 Response to Counting number of specific observations per group
Post a Comment