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

Re: st: egen problem ? (was: poverty decomposition using povdecocommand)


From   [email protected]
To   [email protected]
Subject   Re: st: egen problem ? (was: poverty decomposition using povdecocommand)
Date   Tue, 19 Jul 2005 08:09:59 -0500

-egen newvar =  total(exp), by(var)- requires that all the terms be 
within the parentheses.

Try: 

egen sume = total((gear_ratio*displacement*length)/displ[1]) , by(for)

Scott


----- Original Message -----
From: [email protected]
Date: Tuesday, July 19, 2005 7:44 am
Subject: st: egen problem ? (was: poverty decomposition using povdeco 
command)

> Hi all,
> Ousmane has recently raised a problem using povdeco.
> In fact, his program crashes when egen is invoked.
> In his code, all previous egen calculus went fine expect for a 
special
> sum to be computed.
> I was able to reproduce the problem using auto data.
> However, I am not a so good programmer, so I seek the community's
> help.
> Suppose we have the fancy sum to compute. Here is the result.
> 
> . clear
> . sysuse auto
> (1978 Automobile Data)
> . se tr on
> .
> .
> . egen sume = sum(gear_ratio*displacement*length)/displ[1] , by(for)
> 

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index