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
How to perform impulse response function (IRF) and forecast error variance decomposition (FEVD) based on panel VECM?Hi all, I am currently working on a panel error correction model (PVECM), and trying to perform IRF…
Stata Version and MEOLOGIT Model ConvergenceBasic question here, but when collaborating on analysis with a colleague with a different version of…
weighted averageHi, I have a database of donations and I want to use it to generate a new var to indicate donors ide…
Getting STATA to loop phrases (2 or more words with spaces in between)Hello, I'm trying to construct a foreach loop where I am using a few words as the phrase to loop o…
stack or reshape?Dear All, I have this dataset Code: * Example generated by -dataex-. To install: ssc install datae…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a sum variable of the prior 12 months
Post a Comment