Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

st: calculating the difference in logs

From   "Data Analytics Corp." <>
Subject   st: calculating the difference in logs
Date   Thu, 12 Jul 2012 08:47:20 -0400


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? Am I missing something? It seems that it should work.




Walter R. Paczkowski, Ph.D.
Data Analytics Corp.
44 Hamilton Lane
Plainsboro, NJ 08536
(V) 609-936-8999
(F) 609-936-3733

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index