Statalist The Stata Listserver

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

st: displaying summation of a variable

From   "b. water" <>
Subject   st: displaying summation of a variable
Date   Tue, 24 Jan 2006 17:33:25 +0000

dear statalisters,

Stata 8.2 Window XP Pro SP2,

i have a variable 'total', which represents population (no. of persons) per observation. what i wanted is quite simple - simply to sum(total) to give the overall total no. of person in the dataset. so i did egen sumpopn=sum(total), which created a variable sumpopn filled with a constant equalling the overall sum, then took a peek at it using display sumpopn. it does the job... but is there a shorter way of doing this without -egen- ing a new variable (i know i can always -drop sumpopn- later)?


Express yourself instantly with MSN Messenger! Download today - it's FREE!

* For searches and help try:

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