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
outreg2 for all dataframesHi, I am using Stata 17 and would help in producing tables in all my dataframes. Below is an exampl…
Date-variable: Extracting day-of-month as numericHello everyone, I would highly appreciate your help with the following: I have a date-variable in …
mkspline coefficient interpretation in case of statistical insignificant How can I understand the values of '"p>|t|"? If the p-value of the coefficient is not statistica…
Angrist-Pischke F-Statistic Missing in xtivreg2?Dear all, I have two endogeneous regressors and two instruments. I read that the Kleibergen-Paap rk…
Propensity score matchingGood morning, I would like to evaluate an effect of a shock (my treatment, let's call T) in a varia…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a sum variable of the prior 12 months
Post a Comment