Hello. I have a data set that has the following structure.
hhcode member_id age
1 1 45
1 2 23
1 3 31
2 1 50
2 2 38
2 3 31
2 4 14
3 1 65
3 2 31
3 3 15
I want to make it as follows.
hhcode age_1 age_2 age_3 age_4
1 45 23 31 .
2 50 38 31 14
3 65 31 15 .
Thank you.
Related Posts with Making household-level variables using individual-level variables
Generating change in levels as well as percentages from stataHi All, I have a dataset which resembles the following: x y 1 2 2 4 3 6 I have two variables her…
Create variable depending on many variablesHey stata community, I have a question regarding creating a new variable depending on many other va…
Specify interaction/square terms with xtabond2 & xtdpdgmmDear all, First of all, I would like to confirm that I have searched and read many posts here but n…
how to separate the result by regionI have a number of variables. the variables are insurance types, a region of address, and another 5 …
Bug in wtmean?This is my first post but I hope I have strictly followed the rules. I have the following data Co…
Subscribe to:
Post Comments (Atom)
0 Response to Making household-level variables using individual-level variables
Post a Comment