Statalist The Stata Listserver


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

st: Filling gaps???


From   Honorati Masanja <[email protected]>
To   [email protected]
Subject   st: Filling gaps???
Date   Thu, 30 Nov 2006 01:07:53 +0300

Dear all

I have a dataset with individuals in households. Each individual has a
unique identifier. Some individuals in the households are infected and
some are not. My problem is how do I tell Stata to create a new variable
which will have 1 for households with at least one infected person  and
0 for households without infected persons. The datasets looks like this

HouseholdID  PersonID      Infected
010101         01010101        1
010101         01010102        1
010102         01010201        0
010102         01010202        1
010102         01010203        1
010103         01010301        0
010103         01010302        0
010103         01010303        0
010104         01010401        0
010104         01010402        1

Many thanks

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ifakara Health Research & Development Centre,
Mikocheni Office - Kiko Rd,
P.O.Box 78373,
Dar es Salaam,
Tanzania.

T:+255 22 2774756 (Ext 108)
T:+255 22 2774709 (Ext 108)
F:+255 22 2771714
C:+255 784 60 50 46

email  : [email protected]
website: www.ihrdc.org


[email protected]




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