Classif_programEseg avec LFSc

advertisement
Computer program to build Eseg (ESEG_1 and ESEG_2) in LFS
data lfs ;
set lfs.lfs ;
where year = "2011" and country not in ("CH","IS","NO") ;
run ;
data lfs_eseg ;
set lfs ;
if ilostat = "1" then do ;
isco1 = isco1d ;
isco2 = substr(isco3d, 1, 2) ;
if stapro in ("0","4") then sta = "NS" ;
if stapro = "3" then sta = "S" ;
end ;
/* for the unemployed and non employed persons */
else if ilostat in ("2","3") then do ;
if iscopr3d not in ("0 0","999") then do ;
isco1 = substr(iscopr3d, 1, 1) ;
isco2 = substr(iscopr3d, 1, 2) ;
if stapropr in ("0","4") then sta = "NS" ;
if stapropr = "3" then sta = "S" ;
end ;
else do ;
isco1 = "" ;
isco2 = "" ;
sta = "" ;
end ;
end ;
else do ;
isco1 = "" ;
isco2 = "" ;
sta = "" ;
end ;
/* eseg_1 = aggregated level */
if ilostat in ("1","4") then do ;
if isco1="1" and sta in ("NS", "S") or (isco2="01" and sta="S") then
eseg_1="1" ;
else if (isco1="2" and sta in ("NS", "S")) then eseg_1="2" ;
else if (isco1="3" and sta="S") or (isco2="02" and sta="S") then eseg_1="3" ;
else if isco1 in ("3", "4", "5", "6", "7", "8", "9") and sta="NS" then
eseg_1="4" ;
else if (isco1="4" or isco2 in ("03", "53", "54")) and sta="S" then
eseg_1="5" ;
else if isco1 in ("7", "8") and sta="S" then eseg_1="6" ;
else if (isco1 in ("6", "9") or isco2 in ("51", "52")) and sta="S" then
eseg_1="7" ;
else eseg_1 = "x" ; * missing values ;
end ;
else if ilostat = "2" then do ;
if isco1="1" and sta in ("NS", "S") or (isco2="01" and sta="S") then
eseg_1="1" ;
else if (isco1="2" and sta in ("NS", "S")) then eseg_1="2" ;
else if (isco1="3" and sta="S") or (isco2="02" and sta="S") then eseg_1="3" ;
else if isco1 in ("3", "4", "5", "6", "7", "8", "9") and sta="NS" then
eseg_1="4" ;
else if (isco1="4" or isco2 in ("03", "53", "54")) and sta="S" then
eseg_1="5" ;
else if isco1 in ("7", "8") and sta="S" then eseg_1="6" ;
else if (isco1 in ("6", "9") or isco2 in ("51", "52")) and sta="S" then
eseg_1="7" ;
else do ;
if age < 65 then eseg_1 = "9" ;
else eseg_1 = "8" ;
end ;
end ;
else if mainstat = "4" or (age > 64 and ilostat not in ("1","2")) then do ;
eseg_1 = "8" ;
end ;
else if (mainstat in ("3","5","6","7","8") and age < 65) or age < 15 then do ;
eseg_1 = "9" ;
end ;
else eseg_1 = "" ;
/* Eseg_2 = detailed level */
if "0" < eseg_1 < "8" then do ;
/*Definition
1 Managers
1.1 Higher managerial self-employed (ISCO 11, 12, 13 and status=se)
1.2 Lower managerial self-employed (ISCO 14 and status=se)
1.3 Higher managerial employees (ISCO 11, 12, 13 and 01 and status=e)
1.4 Lower managerial employees (ISCO 14 and status=e)
*/
if isco2 in ("11","12","13") and sta = "NS" then eseg_2 = "11" ;
if isco2 = "14" and sta = "NS" then eseg_2 = "12" ;
if isco2 in ("01","11","12","13") and sta = "S" then eseg_2 = "13" ;
if isco2 = "14" and sta = "S" then eseg_2 = "14" ;
/*
2
2.1
2.2
2.3
2.4
2.5
*/
Definition
Professionals
Science, engineering and information and communications technology (ICT) professionnals (ISCO 21,25)
Health professionals (ISCO 22)
Business and administration professionals (ISCO 24)
Legal, social and cultural professionals (ISCO 26)
Teaching professionals (ISCO 23)
if
if
if
if
isco2
isco2
isco2
isco2
in ("21","25") then eseg_2 = "21" ;
= "22" then eseg_2 = "22" ;
= "24" then eseg_2 = "23" ;
= "26" then eseg_2 = "24" ;
if isco2 = "23" then eseg_2 = "25" ;
/*
3
3.1
3.2
3.3
3.4
3.5
*/
Definition
Technicians and associated professionals employees (status= e)
Science, engineering and ICT technicians and associated professionals (ISCO 31, 35)
Health associate professionals (ISCO 32)
Business and administration associate professionals (ISCO 33)
Legal, social and cultural associate professionals (ISCO 34)
Non-commissioned armed forces officers (ISCO 02 )
if
if
if
if
if
/*
4
4.1
4.2
4.3
*/
isco2
isco2
isco2
isco2
isco2
in ("31","35")
= "32" and sta
= "33" and sta
= "34" and sta
= "02" and sta
and sta = "S" then eseg_2 = "31" ;
= "S" then eseg_2 = "32" ;
= "S" then eseg_2 = "33" ;
= "S" then eseg_2 = "34" ;
= "S" then eseg_2 = "35" ;
Definition
Small entrepreneurs (status= se)
Skilled agricultural self employed workers (ISCO 6)
Technicians, clerical support, services and sales self employed workers (ISCO 3, 4, 5)
Craft and related trades self employed workers (ISCO 7, 8, 9)
if isco1 = "6" and sta = "NS" then eseg_2 = "41" ;
if isco1 in ("3","4","5") and sta = "NS" then eseg_2 = "42" ;
if isco1 in ("7","8","9") and sta = "NS" then eseg_2 = "43" ;
/*
5
5.1
5.2
5.3
5.4
*/
Definition
Clerks and skilled service workers (status=e)
General and numerical clerks and other clerical support employees (ISCO 41, 43, 44)
Customer services clerks (ISCO 42)
Personal care employees (ISCO 53)
Armed forced occupations and protective service employees (ISCO 03 and ISCO 54)
if
if
if
if
/*
6
6.1
6.2
6.3
6.4
6.5
*/
isco2
isco2
isco2
isco2
in ("41","43","44") and sta = "S" then eseg_2 = "51" ;
= "42" and sta = "S" then eseg_2 = "52" ;
= "53" and sta = "S" then eseg_2 = "53" ;
in ("03","54") and sta = "S" then eseg_2 = "54" ;
Definition
Industrial and agricultural employees (status= e)
Building and related trade employees (ISCO 71)
Food processing, wood working, garment employees (ISCO 75)
Metal, machinery, handicraft, printing, electrical and electronic trades employees (ISCO 72, 73, 74)
Stationary plant and machine operators and assemblers (ISCO 81, 82)
Drivers (ISCO 83)
if
if
if
if
if
isco2
isco2
isco2
isco2
isco2
= "71" and sta = "S" then eseg_2 = "61" ;
= "75" and sta = "S" then eseg_2 = "62" ;
in ("72","73","74") and sta = "S" then eseg_2 = "63" ;
in ("81","82") and sta = "S" then eseg_2 = "64" ;
= "83" and sta = "S" then eseg_2 = "65" ;
/* Definition
7 Less skilled workers (status= e)
7.1 Personal services and sales employees (ISCO 51, 52)
7.2 Blue collar employees and food preparation assistants in elementary occupations (ISCO 92, 93, 94, 96)
7.3 Cleaners and helpers and services employees in elementary occupations (ISCO 91, 95)
7.4 Agricultural employees (ISCO 6)
*/
if
if
if
if
isco2
isco2
isco2
isco1
in ("51","52") and sta =
in ("92","93","94","96")
in ("91","95") and sta =
= "6" and sta = "S" then
"S" then eseg_2 = "71" ;
and sta = "S" then eseg_2 = "72" ;
"S" then eseg_2 = "73" ;
eseg_2 = "74" ;
end ;
/*
8
8.1
8.2
8.3
8.4
8.5
8.6
8.7
8.8
*/
Definition
Retired persons (and persons not employed 65 years or more)
Retired Managers
Retired professionals
Retired technicians and associate professionals
Retired small entrepreneurs
Retired skilled service workers
Retired skilled blue-collars
Retired less skilled workers
Other inactive aged 65 or more
if eseg_1 = "8" then do ;
if isco1="1" and sta in ("NS", "S") or (isco2="01" and sta="S") then
eseg_2="81" ;
else if (isco1="2" and sta in ("NS", "S")) then eseg_2="82" ;
else if (isco1="3" and sta="S") or (isco2="02" and sta="S") then eseg_2="83"
;
else if isco1 in ("3", "4", "5", "6", "7", "8", "9") and sta="NS" then
eseg_2="84" ;
else if (isco1="4" or isco2 in ("03", "53", "54")) and sta="S" then
eseg_2="85" ;
else if isco1 in ("7", "8") and sta="S" then eseg_2="86" ;
else if (isco1 in ("6", "9") or isco2 in ("51", "52")) and sta="S" then
eseg_2="87" ;
else eseg_2 = "88" ;
end ;
/*
9
9.1
9.2
9.3
9.4
*/
if
Definition
Other non employed persons
Students
Permanently disabled
Unemployed not elsewhere classified
Other inactive aged less than 65 years
eseg_1 = "9" then do ;
if mainstat = "3" then eseg_2 = "91" ;
if mainstat = "5" then eseg_2 = "92" ;
if mainstat = "2" then eseg_2 = "93" ;
if mainstat in ("6","7","8","9") then eseg_2 = "94" ;
if eseg_2 = "" then eseg_2 = "94" ;
end ;
run ;
/* missing values :
when Isco or/and status are missing for an employed person;
When mainstat and ilostat are inconsistent (inactive and active..)*/
Download