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

From |
Kit Baum <baum@bc.edu> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
st: Re: How to generate "total" observation? |

Date |
Sun, 2 Aug 2009 07:25:56 -0400 |

<.> How about generating a total variable? egen sumvar1 = sum(var1), by(id)

If doing this on the fly is enough, -help tabstat-. E.g. tabstat var1, by(id) stat(sum) Kit Baum | Boston College Economics & DIW Berlin | http://ideas.repec.org/e/pba1.html

An Introduction to Modern Econometrics Using Stata | http://www.stata-press.com/books/imeus.html On Aug 2, 2009, at 02:33 , statalist-digest wrote:

I have a (possible) dummy question. I have a panel data set like thefollowing:id year var1 01 2000 10 01 2001 20 02 2000 15 02 2001 25 I want to create a new observations, with id=03, that sum the var1 over the other ids. Obviously, I'm no going to use this observations to make some estimation, but total statistics. How can I generate this aditional observations.

* * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

- Prev by Date:
**st: Re: sum() returns different results every time, why?** - Next by Date:
**st: SSC Archive activity, July 2009** - Previous by thread:
**st: Re: sum() returns different results every time, why?** - Next by thread:
**st: SSC Archive activity, July 2009** - Index(es):

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