Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: product of a variable
From
Nick Cox <[email protected]>
To
[email protected]
Subject
Re: st: product of a variable
Date
Sat, 20 Oct 2012 21:54:53 +0100
bysort group : gen prod = sum(ln(x))
by group : replace prod = exp(prod[_N])
Also
STB-51 dm71 . . . . . . . . . . . . Calculating the product of observations
(help prod if installed) . . . . . . . . . . . . . . . . . . P. Ryan
9/99 pp.3--4; STB Reprints Vol 9, pp.45--48
extension to egen for producing the product of observations
Nick
On Sat, Oct 20, 2012 at 8:05 PM, Sun Yutao
<[email protected]> wrote:
> Just a silly question, how do I get the product of every element from a certain variable (the "pi" operator in math) in the dataset?
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/