I asked this question yesterday but it was not mentioned in the title so I followed the advice from Clyde Schechter and open a new thread.
I try to use the natural log by sum up my variable "usd" sort by year and month.
The code to do this is the following:
Code:
bys year month : asrol usd, gen(cumusd) stat(sum) window(month 12)
The workaround would be to transform the usd into "ln" first and then use asrol, but I was wondering if there is a direct function to do it?
Here is the dataset example:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input long usd str15 country float(month year deals_uk) 958540 " United Kingdom" 1 2010 3 1580000 " United Kingdom" 1 2010 3 2000000 " United Kingdom" 1 2010 3 1100000 " United Kingdom" 2 2010 2 3000000 " United Kingdom" 2 2010 2 62001 " United Kingdom" 3 2010 1 3690000 " United Kingdom" 4 2010 1 2400000 " United Kingdom" 6 2010 2 18275602 " United Kingdom" 6 2010 2 1503 " United Kingdom" 7 2010 2 49082059 " United Kingdom" 7 2010 2 1736418 " United Kingdom" 8 2010 1 700000 " United Kingdom" 9 2010 1 2532150 " United Kingdom" 10 2010 2 800769 " United Kingdom" 10 2010 2 6000000 " United Kingdom" 1 2011 2 8300000 " United Kingdom" 1 2011 2 3213610 " United Kingdom" 2 2011 2 117296775 " United Kingdom" 2 2011 2 965642 " United Kingdom" 3 2011 2 77743 " United Kingdom" 3 2011 2 4135731 " United Kingdom" 4 2011 3 487692 " United Kingdom" 4 2011 3 28400000 " United Kingdom" 4 2011 3 5083942 " United Kingdom" 5 2011 3 222521 " United Kingdom" 5 2011 3 1000000 " United Kingdom" 5 2011 3 430000 " United Kingdom" 6 2011 1 72561 " United Kingdom" 7 2011 1 71338 " United Kingdom" 8 2011 1 1336631 " United Kingdom" 9 2011 1 142979 " United Kingdom" 11 2011 1 706309 " United Kingdom" 12 2011 1
0 Response to Use Asrol and natural Log.
Post a Comment