Derivation
variable: schlstd (table[s]: cen_individ, crs_cenm, css_sei_all, combined_tb_cases_controls_final [derived table])
variable: schltype (table[s]: this dataset)
replace schlstd=1 if schlstd==. & (schltype==1 | schltype==2) /*assume that those reporting primary or secondary but no standard did just the first year (only a few people)*/
replace schlstd=0 if schlstd==. & (schltype==0 | edqual==0 | schlever==0) /*update school standard to 0 if reported no schooling elsewhere & schlstd is missing*/
replace schlstd=schlstd+8 if schltype==2 & schlstd~=. /*change the secondary standards to 9,10,11,12*/
replace schlstd=8 if schlstd==. & edqual==1 /*update schlstd to 8 if reported to have primary certificate*/
replace schlstd=10 if schlstd==. & edqual==2 /*update schlstd to 10 if reported to have junior certificate*/
replace schlstd=12 if schlstd==. & edqual==3 /*update schlstd to 12 if reported to have msce*/
replace schlstd=13 if (edqual>=4 & edqual~=. & edqual~=8 /*other*/) | schltype==3 /*update schlstd to 13 (tertiary) if reported to have qualification higher than msce*/