Statalist


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

Re: st: generating houshold size


From   Svend Juul <SJ@SOCI.AU.DK>
To   <statalist@hsphsun2.harvard.edu>
Subject   Re: st: generating houshold size
Date   Thu, 28 Aug 2008 09:19:42 +0200

Leonie wrote:

What I want to generate is household income weighted by the number of
persons in the household, but I don't have a variable 'household size'
included in my dataset. What I have is information on each houshold
member from a household grid. This means I have a seperate variable for
each household member.

My question is, therefore, if there is a stata command to sum up the
number of household members over these variables?

==========================================================

If you have the variables mom, dad, c1, c2, c3, ... c20 identifying
household members and if the content is missing if that member does not
exist in this household, you can count the members by:

   egen members = rownonmiss(mom dad c1-c20)

(provided c1-c20 are adjacent in the dataset)

Svend
__________________________________________

Svend Juul
Institut for Folkesundhed, Afdeling for Epidemiologi
(Institute of Public Health, Department of Epidemiology)
Vennelyst Boulevard 6
DK-8000  Aarhus C, Denmark
Phone:  +45 8942 6090
Home:   +45 8693 7796
Email:  sj@soci.au.dk
__________________________________________ 

*
*   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/



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