Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

st: How to change a household-level data set into a respondent-level data set?


From   xueliansharon <xuelianstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: How to change a household-level data set into a respondent-level data set?
Date   Sat, 16 Jun 2012 16:11:43 -0700 (PDT)

Dear all,

I want to change a household-level data set into a respondent-level data
set, but I don't know how to program to realize it, so I need your help. 

The procedure is as follows: 

One section of my data set is household-level, i.e., there's only one record
for each household, and the survey is answered by a family respondent for
each household. The original data structure is like: 

FamR	PersonID	      SpouseID        household income 	own a house
1	1010	                1020	                  100000	              1
1	2020          	2010	                  20000	              0
1	3040	                3041	                  50000	              0
1	4020	                0	                  70000	              1
1	5030	                0	                  40000	              0

Here, the first variable "FamR" is a dummy indicating whether the individual
is a family respondent ("1" implies yes). "PersonID" provides the ID for the
individual, and "SpouseID" provides the ID for the individual's spouse. When
SpouseID=0, it means that the individual doesn't have a spouse. "Household
income" and "Own a house" (dummy) are two variables for each household.

 Now I want to change it into a respondent-level structure, i.e. I want to
generate a record for the family respondent's spouse for each household. The
new data structure should be like:

FamR	   person ID 	spouse ID	  household income	own a house
1	      1010	            1020	     100000	                      1
*0	      1020	            1010	     100000	                      1*
1	      2020	            2010	     20000	                      0
*0	      2010	            2020	     20000	                      0*
1	      3040	            3041	     50000	                      0
*0	      3041	            3040	     50000	                      0*
1	      4020	            4021	     70000	                      1
1	      5030	            5033	     40000	                      0

Please note that, for those added non-family respondents, his/her "person
ID" (e.g. 1020) is the "spouse ID" of the family respondent in the
household, and his/her "spouse ID" (e.g. 1010) is the "person ID" of the
family respondent in the household.

Thank you for your help!

Best,
Xuelian


--
View this message in context: http://statalist.1588530.n2.nabble.com/How-to-change-a-household-level-data-set-into-a-respondent-level-data-set-tp7580207.html
Sent from the Statalist mailing list archive at Nabble.com.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index