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
Including all values for only one over() variable in a bar chartI have a dataset with a "fine" variable that can take many values, and an unrelated "coarse" variabl…
Aggregating oaxaca decompositions of functions of the same variableDear all, Hope you are having a wonderful day! I have a question regarding how to aggregate oaxaca …
kountry commandHi all, I'm trying to generate iso2 codes for all countries (typed out manually) and I have been tol…
kountry commandHi all, I'm trying to generate iso2 codes for all countries (typed out manually) and I have been tol…
Creating table with many simple linear regression (regress) outputsHello. This is my first post here so please feel free to give suggestions on how to format the post,…
Subscribe to:
Post Comments (Atom)
0 Response to Different combinations in each household
Post a Comment