Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

st: best way to add up values sorted by a unique id

From   "Özlen D. Luznar" <>
Subject   st: best way to add up values sorted by a unique id
Date   Thu, 24 Jun 2010 16:25:58 -0400 (EDT)

Hi everyone,

I have a dataset where I am trying to calculate total family income
identified by a unique family id "unifam".  Each person in the unifam has
a totalannual income and I am trying to add totalannual income to
calculate annual family income - at the unifam level.

For example

unifam==1  person=1 totalincome == 60
unifam ==1 person=2 titalincome == 40

unifam=1  totalfamilyincome == 100

unifam ==2 person=1 totalincome = 100
unifam==2 person=2 totalincome= 50
unifam =2 person=3 totalincome =50

unifam =2 totalfamilyincome ==200


Özlen D. Luznar

PhD Candidate - Public Policy
Graduate Research Assistant
University of Maryland Baltimore County (UMBC)
1000 Hilltop Circle
Baltimore, MD 21250


*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index