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
Import text files: Delimiter and Transformation IssuesDear Statalisters, I am trying to import a text file that seems to lack a consistent delimiter. It …
Computing elasticities of the EASI demand modelHello, I estimated the EASI model on consumption data using STATA codes from Pendakur's paper (Easi …
how to compute marginal effects in NBSTRAT (truncated & endogenously stratified negative binomial) model? (Stata)Dear Stata users, I'm using STATA 16.0 to develop recreational demand function via using NBSTRAT mo…
ways to restrict data to certain wavesIn addition to using the command "if wave=certain number," is there another way to restrict data to …
Industry sigma codeIndustry sigma is the mean of standard deviations of cash flow over assets over 20 years, for firms …
Subscribe to:
Post Comments (Atom)
0 Response to Making household-level variables using individual-level variables
Post a Comment