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
Detecting inverted duplicates over two columnsHello, I have searched for an answer to this simple question on previous forums, and cannot find the…
Nested forvalue loops - referring to previous macros in a relevant macroGood afternoon. Could anyone help me decipher what syntax error I am producing in the below command…
Is it possible to not set values of optional integer arguments with the syntax commandWhen specifying optional arguments integer arguments using the syntax command it is usually necessar…
Why the different bootstrap errors in panel data random effects?Hi, in help xt_vce_options I found the following recommendation: When working with panel-data mode…
T Tests and Wilcoxon Tests export to MS Word or MS ExcelHello Members I had been working on EViews for some time, I shifted to Stata now, since I am new, I…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a sum variable of the prior 12 months
Post a Comment