Dear Statalist
I am working with a household data (contains both the household information and members of the household). i defined a variable member10_17 that stores the number of people in particular household for example household 108 within the age bracket(10 - 17), i also want the values returned to repeat across the household. for example, household no 93 will return 0 because there is no member within the age limit so 0 should be repeated four times because there are four members in the household. in my do file i wrote this code:
Code:
by province district community hhno: egen member10_17 = count(a4age) if (a4age>=10) & (a4age<=17)
Code:
(a4age>=10) & (a4age<=17)
please i will appreciate any attempt to help me
Below is the snapshot of the dataset
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input int(hhno a4age) byte(b5labour c4grade) 93 1 . . 93 4 . 1 93 20 9 . 93 40 14 . 96 45 9 . 96 27 3 . 96 67 14 . 96 20 8 12 96 55 9 . 108 10 8 5 108 6 8 . 108 20 8 . 108 60 13 . 120 4 . 1 120 40 13 . 120 1 . . 120 27 9 . 122 25 9 . 131 5 8 1 131 30 9 . 131 7 8 3 end
Comment