I have individual data set. With my dataset I want to create a living arrangement among elderly for each household. For example whether elderly is living alone, living with spouse only, living with spouse and family members. Can some please help me out in creating this new variable with my data. In the below for ro4 relationship with Household head it ranges from (1 to 12 ) and ro5 is age of the respondent.
* Example generated by -dataex-. To install: ssc install dataex
clear
input int(stateid distid psuid hhid ro4 ro5)
1 2 1 2 1 76
1 2 1 2 3 31
1 2 1 2 3 42
1 2 1 2 3 37
1 2 1 2 4 26
1 2 1 2 4 40
1 2 1 2 4 33
1 2 1 2 5 13
1 2 1 2 5 8
1 2 1 2 5 20
1 2 1 2 5 13
1 2 1 2 5 19
1 2 1 2 5 8
1 2 1 2 12 65
1 2 1 3 1 45
1 2 1 3 2 43
1 2 1 3 3 20
1 2 1 3 3 12
1 2 1 3 3 17
1 2 1 3 3 23
1 2 1 3 3 14
1 2 1 4 1 57
1 2 1 4 2 47
1 2 1 4 3 13
1 2 1 4 3 20
1 2 1 4 3 14
1 2 1 5 1 50
1 2 1 5 2 38
1 2 1 5 3 23
1 2 1 5 3 16
1 2 1 5 3 12
1 2 1 5 3 27
1 2 1 5 3 18
1 2 1 6 1 72
1 2 1 6 3 39
1 2 1 6 3 27
1 2 1 6 3 37
1 2 1 6 4 33
1 2 1 7 1 52
1 2 1 7 2 42
1 2 1 7 3 24
1 2 1 7 3 16
1 2 1 7 3 15
1 2 1 7 3 20
1 2 1 7 3 18
1 2 1 7 3 26
1 2 1 8 1 42
1 2 1 8 2 37
1 2 1 8 3 18
1 2 1 8 3 13
end
label values stateid STATEID
label def STATEID 1 "Jammu & Kashmir 01", modify
label def RO4 1 "Head 1", modify
label def RO4 2 "Wife/Husband 2", modify
label def RO4 3 "Son/Daughter 3", modify
label def RO4 4 "Child-in-Law 4", modify
label def RO4 5 "Grandchild 5", modify
label def RO4 6 "Father/Mother 6", modify
label def RO4 7 "Brother/Sister 7", modify
label def RO4 9 "Nephew/Niece 9", modify
label def RO4 10 "Sib-in-Law 10", modify
label def RO4 12 "Servant/Others 12", modify
Related Posts with Different combinations in each household
Combining locals that contain whitespaceI have a series of locals of the form: Code: local list1 "June 2004" local list2 "July 2004" …
Beginner questionHi people, I'm a total noobs to Stata and have spent two hours trying ot figure this dumb thing out…
How to add a variable from 1 data set to another?I have two data sets from 2001 to 2005 and 2006 to 2010, and I want to compare performances of peopl…
T-Test between two varibles with dummy conditionHey, I woul like to know how I could do the t-test between 2 variables if I calculated the mean with…
Odds Ratios instead of Coefficients using teffects?I'm running a series of models using teffects psmatch, teffects ra, and teffects ipw and comparing a…
Subscribe to:
Post Comments (Atom)
0 Response to Different combinations in each household
Post a Comment