Hello. I want to create a variable that shows average attainment at the household level. The weights for averaging across individuals within a household are defined as follows: Attainment score of individual i in the dimension under consideration divided by the total attainment score of that dimension. How can I carry it out?
I have attached an example dataset below.
I have attached an example dataset below.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input byte(hh_id a total_a) 11 4 9 12 4 9 13 6 9 21 6 9 22 6 9 23 6 9 31 7 9 32 6 9 33 5 9 end

Comment