Dear Users,
For a current project I need to create a new variable (call it X), which exist of the sum of the previous 12 months.
I need to compute the total loan facility amount originated in the prior 12 months per Lender. Lender is the obviously the lender , Mdate is the monthly date and Money is the loan facility reported at the certain date. The total dataset is about 200.000 observations from 2000-2018. I've tried it in a few ways, but non of them reported a logical or even close to logical number.
My question: Could you help me to obtain code to generate this variable in stata?
* Example generated by -dataex-. To install: ssc install dataex
clear
input str74 Lender float(Mdate Money)
"Bank of America" 480 126420000
"General Electric Capital Corp" 480 1.20e+08
"ABN AMRO Bank NV [RBS]" 480 166666672
"Bank of America" 480 133333336
"Bank of New York" 480 7.50e+07
"Guaranty Federal Bank" 480 100625000
"Chase Manhattan Bank" 480 5.45e+08
"Chase Manhattan Bank" 480 6.00e+07
"Bank of America" 480 7000000
"Heller Financial Inc" 480 6500000
end
format %tm Mdate
[/CODE]
The method is based on the paper from Cai et all (2018)*
*Cai, Jian & Eidam, Frederik & Saunders, Anthony & Steffen, Sascha. (2017). Syndication, Interconnectedness, and Systemic Risk. Journal of Financial Stability. 34. 10.1016/j.jfs.2017.12.005.
(I'm using the most recent version of Stata).
Related Posts with Creating a sum variable of the prior 12 months
Selecting all dates within groups that are within one week of each other and creating a sub-group idHello all, I'm a new Stata user and new to Statalist; I'm currently using StataMP 14. Purpose: I'm…
Loop with consecutive numbersHello Stata community, I am trying to replace multiple id of a data set, where the ids are consecut…
Pasting the data from Excel to Stata converts values of the variableDear Stata Members I am dealing with some financial data like income, total assets, etc. Many of the…
Selecting dates within groups based on specific criteria in order to create a more unique idHello all, I'm a new Stata user and new to Statalist; I'm currently using StataMP 14. I'm doing so…
Adding 4 arguments in setstars() of asdoc / asdocxI seem to experience an issue with the setstars() arguments using asdoc or asdocx. It seems that it …
Subscribe to:
Post Comments (Atom)
0 Response to Creating a sum variable of the prior 12 months
Post a Comment