Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: calculating the difference in logs


From   "Data Analytics Corp." <[email protected]>
To   [email protected]
Subject   Re: st: calculating the difference in logs
Date   Thu, 12 Jul 2012 09:09:24 -0400

Thought so, but I just needed to confirm.

Thanks

Walt

________________________

Walter R. Paczkowski, Ph.D.
Data Analytics Corp.
44 Hamilton Lane
Plainsboro, NJ 08536
________________________
(V) 609-936-8999
(F) 609-936-3733
[email protected]
www.dataanalyticscorp.com
_____________________________________________________




On 7/12/2012 9:00 AM, Nick Cox wrote:
Time series operators work on variables, not expressions in general, so I don't think there is a short-cut of the kind you seek.

Nick

On 12 Jul 2012, at 13:47, "Data Analytics Corp." <[email protected]> wrote:

Hi,

Suppose I have a time series on annual sales. I'd like to calculate the year-over-year percent change using the difference in the natural logs. I tried

   g pct = d.ln(sales)

but I got an error message "unknown function d.ln()"

Then I tried

   g logg = ln(sales)
   g pct = d.logg

and I got the right answer. I'd like to use just the one line statement as in the first example. Can this be done?
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/




*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index