Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: re:total vs sum


From   Maarten buis <[email protected]>
To   [email protected]
Subject   Re: st: re:total vs sum
Date   Mon, 25 Jun 2007 06:27:22 +0100 (BST)


> --- Sebastian said:
> Can I have the same result if use "egen peso=sum(pesoan)" or "egen
> peso=total(pesoan)"
> 
> Why "gen peso=sum(pesoan)"  has a different result?
 
--- Kit Baum <[email protected]> wrote: 
> They are the same:

The reason that -gen peso = sum(pesoan)- gives different results is
that gen refers back to the build in functions from Stata. -egen- is
specifically designed to extend these functions. To find a list of
built in functions type -help function-. You can than find that the sum
function results in a running sum.

Hope this helps,
Maarten

-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------


      ___________________________________________________________
Yahoo! Answers - Got a question? Someone out there knows the answer. Try it
now.
http://uk.answers.yahoo.com/ 
*
*   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