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

st: AW: RE: count in matched family-individuals file

From   "Martin Weiss" <>
To   <>
Subject   st: AW: RE: count in matched family-individuals file
Date   Wed, 1 Jul 2009 16:31:04 +0200


Joana should replace my earlier line 

bys fam: egen over18=/* 
 */ total(memberage>=18)


bys fam: egen over18=/* 
 */ total(memberage>=18 & memberage<.)

I sought refuge in the statement in the help that missing values count as
zero for this -egen- function, but the -expression- in the parantheses is
never missing although the -memberage- being compared may be... So I have to
check explicitly...


-----Ursprüngliche Nachricht-----
[] Im Auftrag von Nick Cox
Gesendet: Mittwoch, 1. Juli 2009 12:38
Betreff: st: RE: count in matched family-individuals file

This sounds like 

egen nadults = total(age >= 18 & age < .), by(IDhousehold) 

-egen- as I recall is not even mentioned in [U], but there's a help

The Data Management FAQs on are fairly dense with nearby


Joana Estata

I matched 2 files, one of households and other of individuals of each
Now I have a file where the characteristics of each household are
associated with each individuals.
I want:
(a) to create a variable which count how many adults (18+) exist in
each household . Observations are individuals, so it means how many
times the same IDhousehold appears associated with an individual with
18 years old or upper.
(b) add the variable obtained in (a) to the household characteristics
(number of adults per household will be add to other characteristics
as size or income).
I have User Guide STATA Release 9, junt send me to a page.

*   For searches and help try:

*   For searches and help try:

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