Statalist The Stata Listserver


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

Re: st: counting number of children in a household


From   "Austin Nichols" <[email protected]>
To   [email protected]
Subject   Re: st: counting number of children in a household
Date   Thu, 23 Feb 2006 01:56:42 -0500

Many ways to go, but perhaps the easiest to follow is:

egen hhid=group(ent mun numviv numhog)
g kid=age<18
egen nkids=sum(kid), by(hhid)

On 2/22/06, Scott Cunningham <[email protected]> wrote:
> Thanks to those who answered my last question.  I have one more now.
> I need to count how many children are in a given household and assign
> this number to each individual in the same household.
>
> I do not have a specific household id, but rather, I can distinguish
> households by first, the state id (ent), then the municipality id
> (mun), then the community id (numviv), and then household number
> (numhog).
>
> Also, can I some how, assign a specific household id number such that
> I do not have to look at the state, the municipality, the community
> and then the household.

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