Statalist The Stata Listserver


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

st: counting number of children in a household


From   Scott Cunningham <[email protected]>
To   [email protected]
Subject   st: counting number of children in a household
Date   Wed, 22 Feb 2006 23:48:08 -0500

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).

I tried to count as follows:

*Number of Children in the house
*Assume a child in Mexico is less than or equal to 18 years of age
by ent mun numviv numhog: count if age<=18
by ent mun numviv numhog: gen num_child_h=r(N)

My data looks like this:

State Municipality Community Household Person Age
GA 5 4 1 Dave 50
GA 5 4 &! ! nbsp; 1 Diane 10
GA 5 3 1 Linda 5
GA 5 3 1 Stef 45
GA 5 3 2 David 50
GA 5 3 2 Jane 30
GA 5 2 1 Smith 62
GA 5 2 1 Nancy 12

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