******************************************************************************************
************************IBB/IAB Employment survey 1979*********************************
*****************************************Coding the***************************************
************International Standard Classification of Education 97 (ISCED-97)**************
******************************************************************************************

******************************************************************************************
/*
Origin: BIBB-FDZ
Stataversion: 12.0 MP
Reference:
Schroedter, J. H., Lechert, Y., und Lüttinger, P., (2006): Die Umsetzung der Bildungsskala
ISCED-1997 für die Volkszählung 1970, die Mikrozensus-Zusatzerhebung 1971 und die 
Mikrozensen 1976-2004. GESIS.
*/
******************************************************************************************

** occ. degree
gen deg=0
replace deg=1 if v8==3 | v8==2 | v22!=0 & v22!=. | v23!=0 & v23!=. |  v26!=0 & v26!=. | v27!=0 &v27!=. | v28!=0 & v28!=.
replace deg=2 if  v24!=0 & v24!=. | v25!=0 & v25!=. 
replace deg=3 if v31!=0 & v31!=. | v29!=0 & v29!=. | v30!=0 & v30!=.

gen isced=.
replace isced=2 if v3==1
replace isced=3 if v3==2
replace isced=4 if deg==1 
replace isced=5 if v3==3 | v3==4 
replace isced=6 if deg==1 & (v3==3 | v3==4 )
replace isced=7 if deg==2
replace isced=8 if deg==3
replace isced=-4 if isced==.

*****************labeln
#delimit ;
label define isced
-9 "keine Angabe"
-8 "weiß nicht"
-7 "trifft nicht zu"
-6 "ungültig"
-5 "verweigert"
-4 "not classifiable"
-1 "Filter"
0 "0 Pre-primary education / Kindergarten"
1 "1 Primary education on first stage of basic education / Grundschule"
2 "2b Lower secondary education / Hauptschule"
3 "2a Lower secondary education / Mittlere Reife" 
4 "3b Upper secondary education / Abschulss berufl. Ausbildung"
5 "3a Upper secondary education / Fach-|Hochschulreife"
6 "4a Post secondary non tertiary education / Abi + berufl. Ausbildung"
7 "5b First stage of tertiary education / Meister|Techniker"
8 "5a First stage of tertiary education / Uni FH Abschluss"
9 "6 Second stage of tertiary education / Promotion";
#delimit cr

label value isced isced
label var isced "ISCED 97"