I am new to Stata and I need help regarding the code I can use for my question below. Thank you.
MY QUESTION: How do I generate the percentage of men working under "Construction" Industry in each province for different years?
My data is like this:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input double uqnr int year byte(gender province Industry) 101000101 1995 2 1 . 101000102 1995 1 1 6 101000103 1995 1 1 6 101000103 1995 2 1 6 101000104 1995 1 1 6 101000104 1995 2 1 6 101000105 1995 1 1 6 101000106 1995 1 1 5 101000106 1995 2 1 3 101000107 1995 1 1 5 101000107 1995 2 1 6 101000109 1995 1 1 5 101000109 1995 2 1 5 101000113 1995 1 1 5 101000201 1995 1 1 5 101000202 1995 1 1 . 101000203 1995 1 1 5 101000203 1995 1 1 5 101000204 1995 1 1 3 101000204 1995 2 1 6 101000205 1995 1 1 6 101000205 1995 2 1 6 101000206 1995 1 1 3 101000206 1995 2 1 3 101000207 1995 1 1 5 101000207 1995 2 1 . 101000210 1995 1 1 6 101000210 1995 2 1 5 101000211 1995 1 1 5 101000211 1995 2 1 5 101000211 1995 2 1 3 101000301 1995 1 1 1 101000301 1995 2 1 6 101000302 1995 1 1 5 101000302 1995 2 1 3 101000306 1995 2 1 3 101000306 1995 2 1 5 101000307 1995 1 1 6 101000307 1995 2 1 6 101000308 1995 2 1 3 101000308 1995 2 1 3 101000310 1995 2 1 5 101000311 1995 1 1 6 101000311 1995 1 1 3 101000311 1995 2 1 . 101000312 1995 1 1 5 101000402 1995 1 1 6 101000403 1995 1 1 6 101000405 1995 1 1 6 101000405 1995 2 1 3 101000501 1995 1 1 3 101000502 1995 1 1 5 101000502 1995 2 1 6 101000503 1995 1 1 6 101000503 1995 2 1 6 101000504 1995 1 1 6 101000504 1995 2 1 6 101000505 1995 1 1 3 101000507 1995 1 1 6 101000507 1995 2 1 6 101000508 1995 1 1 4 101000508 1995 2 1 6 101000509 1995 2 1 6 101000511 1995 1 1 3 101000511 1995 2 1 3 101000512 1995 1 1 4 101000512 1995 2 1 5 101000601 1995 2 1 6 101000602 1995 1 1 5 101000602 1995 1 1 5 101000603 1995 1 1 5 101000603 1995 1 1 5 101000603 1995 2 1 3 101000605 1995 1 1 5 101000605 1995 2 1 5 101000605 1995 2 1 3 101000607 1995 2 1 7 101000608 1995 1 1 4 101000608 1995 2 1 6 101000610 1995 1 1 5 101000610 1995 2 1 5 101000611 1995 2 1 . 101000701 1995 1 1 3 101000702 1995 1 1 5 101000703 1995 1 1 . 101000703 1995 2 1 7 101000704 1995 1 1 3 101000704 1995 2 1 . 101000704 1995 2 1 3 101000705 1995 1 1 5 101000706 1995 1 1 5 101000706 1995 1 1 3 101000706 1995 1 1 . 101000707 1995 1 1 6 101000707 1995 1 1 5 101000709 1995 1 1 4 101000709 1995 2 1 5 101000710 1995 2 1 7 101000710 1995 1 1 . 101000711 1995 1 1 1 end label values gender gender label def gender 1 "1. Male", modify label def gender 2 "2. Female", modify label values province province label def province 1 "1. Western Cape", modify label values Industry Industry_label label def Industry_label 1 "Agriculture", modify label def Industry_label 3 "Manufacturing", modify label def Industry_label 4 "Construction", modify label def Industry_label 5 "Services", modify label def Industry_label 6 "White-collar", modify label def Industry_label 7 "Domestic", modify
0 Response to How to generate percentages withing groups across years
Post a Comment