Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: running product


From   Gary Longton <glongton@fhcrc.org>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: running product
Date   Thu, 27 Mar 2003 10:36:30 -0800

Alessandra Franzosi wrote:
How is it possible to generate in Stata a new variable that is the running product of another one?
You can always exponentiate the sum of the logs.

gen double rprod = exp(sum(ln(x)))

But it won't take much to exceed numeric storage limits with a running product, however it is generated.

- Gary



*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index