Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | "Data Analytics Corp." <walt@dataanalyticscorp.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | st: calculating the difference in logs |
Date | Thu, 12 Jul 2012 08:47:20 -0400 |
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.loggand 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.
Thanks, Walt ________________________ Walter R. Paczkowski, Ph.D. Data Analytics Corp. 44 Hamilton Lane Plainsboro, NJ 08536 ________________________ (V) 609-936-8999 (F) 609-936-3733 walt@dataanalyticscorp.com www.dataanalyticscorp.com _____________________________________________________ * * 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/