Hi All,
I am working with panel data for 3 periods (waves 3, 4, and 5). I have the following information: unique household identifier (hhid), unique person identifier (pid), wave, age, and household size (hsize).
I want to create a new variable for the number of adults in a household defined as individuals aged 15 and above.
Thanks.
I am working with panel data for 3 periods (waves 3, 4, and 5). I have the following information: unique household identifier (hhid), unique person identifier (pid), wave, age, and household size (hsize).
I want to create a new variable for the number of adults in a household defined as individuals aged 15 and above.
Thanks.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float hhid long pid float(wave age hsize) 300000 304623 3 39 2 300000 304623 4 42 2 300000 304623 5 44 3 300000 304624 3 74 2 300000 304624 4 77 2 300000 304624 5 79 3 300001 305249 3 21 5 300001 305249 4 23 4 300001 305249 5 25 5 300001 305250 3 52 5 300001 305250 4 55 4 300001 305250 5 57 5 300001 305268 3 55 5 300001 305268 4 57 4 300001 305268 5 59 5 300001 305269 3 28 5 300001 305269 4 30 1 300001 305269 5 32 1 300001 620952 3 4 5 300001 620952 4 6 4 300001 620952 5 8 5 300002 319161 3 24 1 300002 319161 4 27 1 300002 319161 5 29 2 300003 305291 3 51 . 300003 305291 4 53 2 300003 305291 5 55 4 300003 309522 3 56 . 300003 309522 4 . . 300003 309522 5 . . 300003 402779 3 9 . 300003 402779 4 12 4 300003 402779 5 13 4 300003 582536 3 29 . 300003 582536 4 31 2 300003 582536 5 33 4 300003 583034 3 27 . 300003 583034 4 30 1 300003 583034 5 31 1 300004 302034 3 23 1 300004 302034 4 26 1 300004 302034 5 28 1 300005 303039 3 44 1 300005 303039 4 47 1 300005 303039 5 49 1 300006 305649 3 52 2 300006 305649 4 54 1 300006 305649 5 56 1 300006 311353 3 90 2 300006 311353 4 93 7 300006 311353 5 . . 300007 407393 3 8 . 300007 407393 4 11 . 300007 407393 5 13 4 300007 407397 3 6 . 300007 407397 4 8 . 300007 407397 5 10 3 300008 319052 3 34 4 300008 319052 4 37 7 300008 319052 5 39 8 300008 321630 3 52 4 300008 321630 4 55 7 300008 321630 5 57 3 300008 321631 3 60 4 300008 321631 4 63 7 300008 321631 5 65 3 300008 410590 3 13 4 300008 410590 4 15 7 300008 410590 5 18 3 300009 301903 3 26 1 300009 301903 4 28 1 300009 301903 5 30 1 300010 381188 3 22 . 300010 381188 4 24 7 300010 381188 5 26 2 300010 409493 3 14 . 300010 409493 4 16 3 300010 409493 5 19 6 300010 409494 3 17 . 300010 409494 4 19 3 300010 409494 5 22 6 300010 620604 3 2 . 300010 620604 4 5 7 300010 620604 5 7 2 300011 319823 3 50 . 300011 319823 4 53 . 300011 319823 5 55 . 300011 319824 3 22 . 300011 319824 4 24 . 300011 319824 5 27 . 300011 319825 3 46 . 300011 319825 4 49 . 300011 319825 5 51 . 300011 470329 3 18 . 300011 470329 4 20 . 300011 470329 5 23 . 300012 315004 3 54 9 300012 315004 4 56 9 300012 315004 5 58 10 300012 315005 3 53 9 end
Comment