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

st: RE: egen problem ? (was: poverty decomposition using povdeco command)

From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: egen problem ? (was: poverty decomposition using povdeco command)
Date   Tue, 19 Jul 2005 14:16:04 +0100

I don't understand how -povdeco- is involved here. 

As far as your -egen- call is concerned, the programming 
manual is not needed, but just the help for -egen-. 

Your call 

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

is illegal. You can't put arbitrary expressions on the RHS of 
an -egen- call. You can, in this case, put an expression 
inside the call to -sum()- 


but not outside 

sum(      )<illegal> 

Remember the -sum()- here is an -egen- function, not the -sum()-

[email protected] 

[email protected]
> 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)
> I do not why the last syntax is not going through.
> And I do not have the programming
> manual to find a solution.

*   For searches and help try:

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