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

Re: st: running product

From   Gary Longton <>
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:

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