Hello,
I've been working CPS basic monthly sample and in the below data sample ahrswork1 stands for hours worked last week. CPSIDP is the indicator through which you can connect the same person being interviewed in different waves. I'd like to code up the share of working hour of a profession: occ2010 = 6010 ( which takes this value for agricultural inspector ) , and they belong to the industry of farming , fishing and agriculture - which I classified as ind_class ==1.
All I wanna do is to code up - the hours worked last week ( ahrswork1) by the occ2010=6010 as the share of hours worked last week ( ahrswork1) by the total industry ( ind_class==1) in each month of each year in each state. Could anyone kindly tell me how I can do it ? Would be very kind if I get a lead on this. Thanks in advance !
. dataex cpsidp month year ahrswork1 occ2010 ind_class statefip
----------------------- copy starting from the next line -----------------------
[CODE]
* Example generated by -dataex-. For more info, type help dataex
clear
input double cpsidp byte month int(year ahrswork1 occ2010) float ind_class byte statefip
19950900000901 7 1996 40 8965 4 1
19950900000901 8 1996 59 8965 4 1
19950900000901 9 1996 60 8965 4 1
19950900000902 7 1996 48 5250 13 1
19950900000902 8 1996 50 5250 13 1
19950900000902 9 1996 36 5250 13 1
19950900001001 7 1996 999 9999 1 1
19950900001001 8 1996 999 9999 1 1
19950900001001 9 1996 999 9999 1 1
19950900001101 7 1996 999 9999 1 1
19950900001101 8 1996 999 9999 1 1
19950900001101 9 1996 999 4230 12 1
19950900001102 7 1996 999 9999 1 1
19950900001102 8 1996 999 9999 1 1
19950900001102 9 1996 999 9999 1 1
19950900001201 7 1996 999 9999 1 1
19950900001201 8 1996 999 9999 1 1
19950900001201 9 1996 999 9999 1 1
19950900001202 7 1996 999 9999 1 1
19950900001202 8 1996 999 9999 1 1
19950900001202 9 1996 999 9999 1 1
19950900001301 8 1996 40 5610 4 1
19950900001301 9 1996 40 5610 4 1
19950900001301 10 1996 50 8300 10 1
19950900001402 8 1996 40 5160 8 1
19950900001402 9 1996 40 5160 8 1
19950900001402 10 1996 40 5160 8 1
19950900001601 8 1996 999 9999 1 1
19950900001601 9 1996 999 9999 1 1
19950900001601 10 1996 999 9999 1 1
19950900001602 8 1996 999 9999 1 1
19950900001602 9 1996 999 9999 1 1
19950900001602 10 1996 999 9999 1 1
19950900001701 8 1996 40 5800 9 1
19950900001701 9 1996 40 5800 9 1
19950900001701 10 1996 40 5800 9 1
19950900001801 8 1996 40 730 12 1
19950900001801 9 1996 40 730 12 1
19950900001801 10 1996 40 730 12 1
19950900001901 8 1996 40 8620 5 1
19950900001901 9 1996 40 8620 5 1
19950900001901 10 1996 40 8620 5 1
19950900001902 8 1996 999 9999 1 1
19950900001902 9 1996 999 9999 1 1
19950900001902 10 1996 999 9999 1 1
19950900002001 9 1996 999 9999 1 1
19950900002001 10 1996 999 9999 1 1
19950900002001 11 1996 999 9999 1 1
19950900002101 9 1996 999 2540 12 1
19950900002101 10 1996 999 2540 12 1
19950900002101 11 1996 999 2540 12 1
19950900002102 9 1996 999 9999 1 1
19950900002102 10 1996 999 9999 1 1
19950900002102 11 1996 999 9620 7 1
19950900002103 9 1996 999 9999 1 1
19950900002103 10 1996 999 9999 1 1
19950900002103 11 1996 999 9999 1 1
19950900002201 9 1996 40 4700 7 1
19950900002201 10 1996 40 4700 7 1
19950900002201 11 1996 45 4700 7 1
19950900002202 9 1996 38 5350 5 1
19950900002202 10 1996 38 5350 5 1
19950900002202 11 1996 40 5350 5 1
19950900002203 9 1996 999 9999 1 1
19950900002203 10 1996 999 4000 7 1
19950900002203 11 1996 20 4720 7 1
19950900002301 9 1996 999 9999 1 1
19950900002301 10 1996 999 9999 1 1
19950900002301 11 1996 999 9999 1 1
19950900002302 9 1996 999 9999 1 1
19950900002302 10 1996 999 9999 1 1
19950900002302 11 1996 999 9999 1 1
19950900002401 10 1996 48 2840 9 1
19950900002401 11 1996 40 2840 9 1
19950900002402 10 1996 999 5810 8 1
19950900002402 11 1996 999 5810 8 1
19950900002501 9 1996 999 9999 1 1
19950900002501 10 1996 999 9999 1 1
19950900002501 11 1996 999 9999 1 1
19950900002502 9 1996 999 2300 12 1
label values month month_lbl
label def month_lbl 7 "July", modify
label def month_lbl 8 "August", modify
label def month_lbl 9 "September", modify
label def month_lbl 10 "October", modify
label def month_lbl 11 "November", modify
label def month_lbl 12 "December", modify
label values ahrswork1 ahrswork1_lbl
label def ahrswork1_lbl 999 "NIU", modify
label values occ2010 occ2010_lbl
label def occ2010_lbl 620 "Human Resources, Training, and Labor Relations Specialists", modify
label def occ2010_lbl 730 "Other Business Operations and Management Specialists", modify
label def occ2010_lbl 2300 "Preschool and Kindergarten Teachers", modify
label def occ2010_lbl 2540 "Teacher Assistants", modify
Related Posts with Share of working hour of an occupation in whole industry
Help in generating a variable based on certain conditionDear All I want to create a disability identifier based on the following criteria those who respon…
missing value for string type and missing value for numeric typeHi , I'm now trying to replace the two conditions. If the variable is the string, replace var ==" OR…
Estimating Total Factor Productivity for panel data in StataHi, I am a new STATA 15 user. I am doing my assignment on estimating the Total Factor Productivity f…
Forloops in panel data - am I indexing incorrectly?I am trying to use a loop in stata to achieve the following: My example data is below, but a brief …
Forloops in panel data - am I indexing incorrectly and using 'if' statements correctly?I am trying to use a loop in stata to achieve the following: My example data is below, but a brief …
Subscribe to:
Post Comments (Atom)
0 Response to Share of working hour of an occupation in whole industry
Post a Comment