Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: question for hierarchical (i.e. hh & person) file


From   F V <[email protected]>
To   [email protected]
Subject   st: question for hierarchical (i.e. hh & person) file
Date   Thu, 6 Oct 2005 10:58:58 -0700 (PDT)

Hi,

I have a very large data-set (i.e. around 60,000
households, and around 320,000 individuals). say that
i have three variables: a hh identifier, a person
identifier, and an X1 variable of interest that
measures whether a person is X1 or not.


UIDhhstr	X1	UIDpersonstr
01101021	1	0110102101
01101021	0	0110102102
01101021	0	0110102103
01101031	1	0110103101
01101031	0	0110103102
01101031	0	0110103103
01101031	0	0110103104
01101031	0	0110103105
01101031	0	0110103106


say I wanted to tell Stata: gen a variable X2 such
that it takes the value of 1 if for any member of a
household X1==1. how can i do this in stata? after
generating X2, then i could collapse the data down to
the household level.

thanks for your kind advice to a stats-beginner.

best wishes.

frank. 




		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com
*
*   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