Hello,
I need to build a table with some descriptive statistics of an unbalanced panel dataset (waves 1 - 5). Can you please help me witth the code to build a table for between part (frequency and percentage) of abused by sex, groups of age and h_educ?
I send an exampke of the dataset bellow. Thank you very much in advance.
I need to build a table with some descriptive statistics of an unbalanced panel dataset (waves 1 - 5). Can you please help me witth the code to build a table for between part (frequency and percentage) of abused by sex, groups of age and h_educ?
I send an exampke of the dataset bellow. Thank you very much in advance.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input long pidp byte sex int dvage float group_age byte h_educ float(wave abused) 205566727 1 44 3 1 5 0 546292364 1 32 2 1 4 1 408070727 1 53 4 0 2 0 544546055 1 18 1 0 3 0 137025447 1 61 5 0 1 0 953276367 1 38 3 1 5 0 1157793847 1 38 3 0 5 0 681004367 1 50 4 0 2 0 1224670487 1 48 4 0 3 0 1632119007 1 86 5 0 4 0 681340967 1 32 2 1 4 0 408758891 1 51 4 1 4 0 613347773 1 31 2 0 4 0 1020263171 1 51 4 0 2 0 1224193127 1 57 5 1 5 0 1088369247 1 67 5 0 4 0 816097251 1 46 4 0 3 0 816725565 1 79 5 . 2 0 680650087 1 49 4 0 3 0 476495727 1 78 5 0 5 0 818626847 1 49 4 0 5 0 408059851 1 42 3 0 2 0 68572579 1 21 1 0 1 0 1440498490 1 43 3 0 3 0 273047288 1 31 2 1 2 0 476497775 1 22 1 0 1 0 1429353207 1 57 5 0 5 0 1429030211 1 58 5 0 4 0 817238364 1 36 3 0 4 0 681262091 1 50 4 1 1 0 272230527 1 33 2 1 4 0 476497783 1 21 1 0 2 0 69311051 1 30 2 1 2 0 476497783 1 25 1 0 4 0 681159415 1 22 1 0 4 0 478744495 1 26 2 0 3 0 89300325 1 45 3 0 4 0 1022188939 1 17 1 0 3 0 680999611 1 49 4 0 4 0 1360122536 1 28 2 0 4 0 476504571 1 62 5 0 2 0 415398488 1 67 5 1 5 0 476504571 1 69 5 0 5 0 1496545387 1 20 1 0 1 0 1020410727 1 30 2 0 2 0 613190687 1 72 5 0 1 0 548041245 1 42 3 . 2 0 69102287 1 64 5 1 2 0 1513877330 1 40 3 0 3 0 682551367 1 73 5 1 5 0 680138739 1 29 2 0 1 0 476506611 1 67 5 0 5 0 1428889447 1 39 3 1 1 0 89358125 1 47 4 0 1 0 1224578007 1 62 5 0 1 0 545168247 1 71 5 0 1 0 682492887 1 63 5 0 4 0 476516131 1 66 5 0 4 0 354345285 1 37 3 0 4 0 478094417 1 34 2 0 3 0 273083927 1 76 5 0 3 0 205778895 1 18 1 0 2 0 1224214211 1 65 5 0 1 0 206445975 1 24 1 1 3 0 748276091 1 64 5 0 2 0 1293998535 1 18 1 0 5 0 626549969 1 44 3 0 1 0 1361165527 1 45 3 0 5 0 614129775 1 35 2 0 3 0 1496765011 1 49 4 0 1 0 1633264131 1 45 3 0 5 0 476531087 1 83 5 0 2 0 818668325 1 61 5 1 5 0 1156716731 1 49 4 0 3 0 1020881967 1 36 3 0 2 0 204050327 1 55 4 0 3 0 218496249 1 39 3 0 2 0 750717295 1 57 5 0 5 0 342454129 1 45 3 . 1 0 952632528 1 27 2 0 2 0 1633321935 1 57 5 1 3 0 68990771 1 28 2 1 2 0 544735767 1 52 4 0 4 0 299990165 1 81 5 . 1 0 1088664367 1 50 4 1 1 0 818778485 1 67 5 0 5 0 1157527971 1 36 3 0 1 0 138745179 1 44 3 0 5 0 1089077811 1 51 4 0 1 0 408373329 1 75 5 . 5 0 682509209 1 46 4 . 2 0 816701292 1 17 1 0 5 0 1497122011 1 47 4 1 1 0 1157022051 1 33 2 0 2 0 683163365 1 46 4 . 2 0 272646011 1 47 4 1 5 0 640266925 1 58 5 0 4 0 680293087 1 65 5 1 1 0 1224433847 1 59 5 0 4 0 340670487 1 40 3 1 4 0 end label values sex c_sex label def c_sex 1 "male", modify label values dvage c_dvage label values group_age group_age label def group_age 1 "25 >= age > 15", modify label def group_age 2 "35 >= age > 25", modify label def group_age 3 "45 >= age > 35", modify label def group_age 4 "55 >= age> 45", modify label def group_age 5 "age > 55", modify label values h_educ h_educ label def h_educ 0 "all except higher education", modify label def h_educ 1 "higher education", modify label values abused abc label def abc 0 "not abused at work", modify label def abc 1 "abused at work", modify