Bookmark and Share

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

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

RE: st: Looping Enquiry

From   Valerie Orozco <[email protected]>
To   "[email protected]" <[email protected]>
Subject   RE: st: Looping Enquiry
Date   Thu, 29 Sep 2011 13:55:22 +0000

Dear George,

The first idea that comes in my mind is to transform the problem.
If you think in a sum rather than in a product it will be easier to program it.
Indeed,  since the logarithm of a product is the sum of the logarithms, you can use it to program you formula easier in Stata.

score	transform to log	generate a cumulative sum	transform to exponential to have what you want 
x1	lnx1	                                         lnx1	                                                  x1
x2	lnx2	                                         lnx1+lnx2	                                                     x1x2
x3	lnx3	                                                  lnx1+lnx2+lnx3	              x1x2x3

Hope this helps.


Valérie OROZCO
Toulouse School of Economics (INRA-GREMAQ)
21, allée de Brienne
F-31000 Toulouse, France

MF 219
+33 5 61 12 85 91

*   For searches and help try:

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