*** GEODE project workshop 16th January 2007 ** Exercise 2: illustration of linking European Social Survey data ** to CAMSIS scale scores using conventional methods. ** Stata version. ************************************************. ** File path declarations for your computer * (different declarations might call the same path): . ** . global path1 "c:\geode\workshop\" ** :. global path2 "c:\geode\workshop\" ** Location of the ISEI translation file:. global path3 "c:\geode\workshop\" ** Location of a directory for storing temporary files. global path9 "c:\temp\" ************************************************. use $path1\ess_2001extract.dta, clear numlabel _all, add tab cntry tab iscoco * 4-digit data tab gndr tab emplrel tab jbspv tab njbspv sort cntry by cntry: summarize emplrel jbspv njbspv iscoco *****************************************. ** Match in occupational information :. ***************************************. ** 1) ISEI:. capture do $path3\iskoisei.ado summarize iscoco iskoisei isei, isko(iscoco) summarize iscoco isei graph bar (mean)isei if (gndr==1 | gndr==2), asyvars over(gndr) over(cntry) * Note - ISEI match is fairly straigtforward because it only needs * one index variable (iscoco) and is the same across countries. *****************************************. *** 2) CAMSIS :. * Note - CAMSIS match is more difficult because it needs needs two * index variables (iscoco and employment status), and because it works * in different ways for the nine different countries . tab cntry ********** ** * i) preliminary - specify an employment status variable valid across countries. * (the variable has already been calculated in the extract file). *tab emplrel *gen stdempst=emplrel *recode stdempst 1=6 2=2 3=5 *=0 *label define stdeml 0 "Unknown" 2 "Self-employed" 5 "Family worker" 6 "Employee" *label values stdempst stdeml *numlabel _all, add *tab stdempst **. tab iscoco tab stdempst gen idno= _n sort cntry idno sav $path9\temp.dta, replace ***************************. ** Locate occuaptional information one country at a time, adjusting any values * to coincide with ESS data, and merging with the ESS sample for that country. ** UK infix iscoco 1-6 stdempst 7-12 ukempst 13-18 mcamsis 19-24 fcamsis 25-30 using "$path2\gb91isco88.dat", clear summarize sort iscoco stdempst tab stdempst * no 5 is covered so recode 5 to make 0. keep iscoco stdempst mcamsis fcamsis sav $path9\mtch2.dta, replace use $path9\temp.dta, clear keep cntry idno iscoco stdempst keep if cntry=="GB" recode stdempst 5=0 sort iscoco stdempst merge iscoco stdempst using $path9\mtch2.dta keep if (_merge==1 | _merge==3) summarize drop _merge sav $path9\ess1.dta, replace ** Czech Republic insheet using $path2\cz94isco88.dat, clear summarize gen iscoco=isco88 sort iscoco stdempst keep iscoco stdempst mcamsis fcamsis sav $path9\mtch2.dta, replace use $path9\temp.dta, clear keep cntry idno iscoco stdempst keep if cntry=="CZ" recode stdempst 2 5=0 sort iscoco stdempst merge iscoco stdempst using $path9\mtch2.dta keep if (_merge==1 | _merge==3) summarize drop _merge sav $path9\ess2.dta, replace ** Hungary . infix iscoco 1-5 stdempst 6-12 huempst 13-16 mcamsis 17-22 fcamsis 23-27 /// isei 28-34 siops 35-39 using $path2\hu96isco88.dat, clear summarize sort iscoco stdempst tab stdempst * No 5, so recode it to 0. keep iscoco stdempst mcamsis fcamsis sav $path9\mtch2.dta, replace use $path9\temp.dta, clear keep cntry idno iscoco stdempst keep if cntry=="HU" recode stdempst 5=0 sort iscoco stdempst merge iscoco stdempst using $path9\mtch2.dta keep if (_merge==1 | _merge==3) summarize drop _merge sav $path9\ess3.dta, replace ** Ireland . infix iscoco 1-6 stdempst 7-12 mcamsis 13-18 fcamsis 19-24 /// isei 25-30 siops 31-36 using $path2\ie96isco88.dat, clear summarize tab stdempst sort iscoco stdempst * only zero so code all to zero. * (remove duplicate cases ). gen first=1. replace first=0 if iscoco[_n-1]==iscoco tab first keep if first==1 keep iscoco stdempst mcamsis fcamsis sav $path9\mtch2.dta, replace use $path9\temp.dta, clear keep cntry idno iscoco stdempst keep if cntry=="IE" recode stdempst 2 5 6=0 sort iscoco stdempst merge iscoco stdempst using $path9\mtch2.dta keep if (_merge==1 | _merge==3) summarize drop _merge sav $path9\ess4.dta, replace ** Poland :. infix iscoco2 1-5 mcamsis 6-10 fcamsis 11-15 isei 16-20 siops 21-25 /// using $path2\plcherisco88.dat, clear gen stdempst=0 * (no info so must code all to 0). keep iscoco2 stdempst mcamsis fcamsis sort iscoco2 stdempst sav $path9\mtch2.dta, replace use $path9\temp.dta, clear keep cntry idno iscoco stdempst keep if cntry=="PL" recode stdempst 2 5 6=0 gen iscoco2 = floor(iscoco/100) sort iscoco2 stdempst merge iscoco2 stdempst using $path9\mtch2.dta keep if (_merge==1 | _merge==3) summarize drop _merge sav $path9\ess5.dta, replace ** Portugal :. infix iscoco2 1-5 mcamsis 6-10 fcamsis 11-15 isei 16-20 siops 21-25 /// using $path2\ptcherisco88.dat, clear gen stdempst=0 * (no info so must code all to 0). keep iscoco2 stdempst mcamsis fcamsis sort iscoco2 stdempst sav $path9\mtch2.dta, replace use $path9\temp.dta, clear keep cntry idno iscoco stdempst keep if cntry=="PT" recode stdempst 2 5 6=0 gen iscoco2 = floor(iscoco/100) sort iscoco2 stdempst merge iscoco2 stdempst using $path9\mtch2.dta keep if (_merge==1 | _merge==3) summarize drop _merge sav $path9\ess6.dta, replace ** Slovenia insheet using $path2\sv94isco88.dat, clear summarize tab stdempst * (Just a 1 and 6 so recode 2 and 5 to 1). gen iscoco=isco88 sort iscoco stdempst keep iscoco stdempst mcamsis fcamsis sav $path9\mtch2.dta, replace use $path9\temp.dta, clear keep cntry idno iscoco stdempst keep if cntry=="SI" recode stdempst 2 5=1 sort iscoco stdempst merge iscoco stdempst using $path9\mtch2.dta keep if (_merge==1 | _merge==3) summarize drop _merge sav $path9\ess7.dta, replace ** Sweden insheet using $path2\se90isco88.dat, clear summarize tab stdempst * just 2 and 6 so recode the 5 to 0. gen iscoco=isco sort iscoco stdempst keep iscoco stdempst mcamsis fcamsis sav $path9\mtch2.dta, replace use $path9\temp.dta, clear keep cntry idno iscoco stdempst keep if cntry=="SE" recode stdempst 5=0 sort iscoco stdempst merge iscoco stdempst using $path9\mtch2.dta keep if (_merge==1 | _merge==3) summarize drop _merge sav $path9\ess8.dta, replace ** Switzerland insheet using $path2\ch90isco88.dat, clear summarize gen iscoco=isco88 sort iscoco stdempst keep iscoco stdempst mcamsis fcamsis sav $path9\mtch2.dta, replace use $path9\temp.dta, clear keep cntry idno iscoco stdempst keep if cntry=="CH" sort iscoco stdempst merge iscoco stdempst using $path9\mtch2.dta keep if (_merge==1 | _merge==3) summarize drop _merge sav $path9\ess9.dta, replace ** Combine all occ info with original files use $path9\ess1.dta, clear append using $path9\ess2.dta append using $path9\ess3.dta append using $path9\ess4.dta append using $path9\ess5.dta append using $path9\ess6.dta append using $path9\ess7.dta append using $path9\ess8.dta append using $path9\ess9.dta tab cntry summarize sort cntry idno merge cntry idno using $path9\temp.dta tab _merge gen cs=mcamsis replace cs=fcamsis if gndr==2 summarize cs correlate cs mcamsis fcamsis summarize iscoco cs isei table cntry gndr if (iscoco >= 1 & iscoco <= 9999), c(mean cs mean isei mean iscoco ) table cntry gndr if (iscoco >= 1 & iscoco <= 9999), c( n cs n isei n iscoco ) graph bar (mean) isei (mean) cs if (gndr==1 | gndr==2) , asyvars over(gndr) over(cntry) ****************************. mvdecode hincfel, mv(8,9) tab hincfel sort cntry by cntry: correlate isei cs mcamsis fcamsis hincfel