** user=**** ** password=**** ** package=stata ** project=lis #delimit; * Sweden LIS 1992 : Example CAMSIS matching ; * (here to person file, applies equally to household file occ vars); use $sw92p; * Current occ unit (nyk minor group)=pocc; gen nykmin=-999; replace nykmin=pocc if (pocc >= 0 ); * employment status info from plfs and ptypewk, here use former; gen empst=0; replace empst=1 if (plfs==4); replace empst=2 if (plfs==1 | plfs==2 | plfs==3); label define stat 0 "Unknown employment status" 1 "Self-employed" 2 "Employee" ; label values empst stat; label variable empst "Employment status"; tab empst psex; * Key indexing variables are nykmin and empst; tabulate empst, summarize(nykmin) mean standard freq ; * Check the employed info only ; tabulate empst if (nykmin > 0) , summarize(nykmin) mean standard freq ; sort nykmin empst; save cstemp, replace; clear; infile nykmin empst mcam fcam using $mydata\camsis\csswis92.dat; summarize; sort nykmin empst; merge nykmin empst using cstemp; gen occinfo=_merge; tab occinfo; drop if (occinfo==1); * (this removes those CAMSIS nykmin by empst values which are not represented in the LIS sample); tab occinfo psex; * Current values are within gender; * also can make a cross-gender CAMSIS variable : ; gen cgentcs=-999; replace cgentcs=mcam if (psex==1); replace cgentcs=fcam if (psex==2); summarize nykmin empst cgentcs ; summarize nykmin empst cgentcs if pocc > 0; * a fair few missing values - about 88% of cases with a present * occ get a camsis value matched to them successfully, the * rest have no corresponding nyk value on the camsis index file; ***************************************; * Quick assessment: compare values by an education recode; gen educ=peduc; recode educ 0 2 3 =1 4 5=2 6 7 8 =3 *=-9; label define edu 1 "Primary or less" 2 "Intermediate" 3 "Secondary or higher" ; label values educ edu; label variable educ "education categories"; tab educ ; sort psex; by psex: summarize educ cgentcs if pocc > 0; by psex: oneway cgentcs educ if (pocc > 0), tabulate; *****************************************;