{"id":19,"date":"2014-05-02T16:56:27","date_gmt":"2014-05-02T14:56:27","guid":{"rendered":"http:\/\/people.unil.ch\/danieloesch\/?page_id=19"},"modified":"2026-03-03T09:02:59","modified_gmt":"2026-03-03T08:02:59","slug":"scripts","status":"publish","type":"page","link":"https:\/\/people.unil.ch\/danieloesch\/scripts\/","title":{"rendered":"Scripts for Social Class &amp; OEP"},"content":{"rendered":"<p>For<strong> social class,<\/strong> you find below codes in Stata, R, SPSS and SAS for constructing my class scheme (discussed here in <a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2014\/05\/Oesch_International_Sociology.pdf\">2006<\/a> and <a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2023\/12\/Oesch_2023_ContemporaryClassAnalysis_OUP.pdf\">2023<\/a>). To write your own code, refer to the Excel sheets below, which show how occupations are assigned to classes.<\/p>\n<p>For <strong>Stata<\/strong>, Ben Jann (University of Bern) has written the Stata module <a href=\"https:\/\/www.statalist.org\/forums\/forum\/general-stata-discussion\/general\/1773662-new-crosswalk-command-for-fast-and-flexible-bulk-recoding-available-from-ssc\">crosswalk<\/a> which creates my class scheme based on ISCO (&#8220;ssc install crosswalk&#8221; &amp; &#8220;help crosswalk&#8221;). <strong>For R<\/strong>, the same is possible using the <a href=\"https:\/\/cimentadaj.github.io\/DIGCLASS\/index.html\">DIGCLASS package<\/a>, developed by the EU-JRC DIGCLASS team.<\/p>\n<p>For <strong>occupations&#8217; earning potential OEP <\/strong>(<a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2025\/08\/oesch_lipps_shahbazian_bihagen_morris_2025_occupationalearningpotential_oep.pdf\">discussed here<\/a>), you can download the Excel files that assign OEP values to occupations <a href=\"https:\/\/osf.io\/pr89u\/files\/osfstorage\">here<\/a> for ISCO-88 and ISCO-08 (1- to 4-digit). Besides the common scale, these files also show the specific OEP values for Germany, Sweden, Switzerland, the UK and the US.<\/p>\n<p>For <strong>Stata<\/strong>, the Stata module <a href=\"https:\/\/ideas.repec.org\/c\/boc\/bocode\/s459420.html\">crosswalk<\/a> creates OEP values based on ISCO. <strong>For R<\/strong>, the <a href=\"https:\/\/cimentadaj.github.io\/DIGCLASS\/reference\/isco08_to_oep.html\">DIGCLASS package<\/a> does the same, constructing OEP values for ISCO occupations.<\/p>\n<h6>Occupations (ISCO) into classes<\/h6>\n<p><a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2014\/05\/Final_proposition_passage_ISCO08_Oesch_10_06_2014.xls\">Excel<\/a> for occupations measured with ISCO-08 (4-digits)<\/p>\n<p><a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2014\/05\/Passage_ISCO08_2DIGIT_Oesch_7Jan2015.xls\">Excel<\/a> for occupations measured with ISCO-08 (2-digits)<\/p>\n<p><a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2014\/05\/ISCO88_codes_16classes_3April2013.xlsx\">Excel <\/a>for occupations measured with ISCO-88 (4-digits)<\/p>\n<p><a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2014\/05\/ISCO88_2DIGIT_codes_16classes_7January2015.xlsx\">Excel <\/a>for occupations mesured with ISCO-88 (2-digits)<\/p>\n<h6>European Social Survey (ESS)<span style=\"text-decoration: underline\"><br \/><\/span><\/h6>\n<p>For a summary of my class schema and its coding in the ESS, see <a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2020\/11\/Description_SocialClassPackage_ESS_25Nov2020.pdf\">pdf <img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-26\" src=\"https:\/\/people.unil.ch\/danieloesch\/files\/2014\/05\/image_pdf.gif\" alt=\"image_pdf\" width=\"15\" height=\"15\" \/><\/a><\/p>\n<p>ESS 2002-2006 (rounds 1 to 3) in <a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2014\/05\/Oesch_class_schema_ESS2002_2006_Stata.txt\">Stata<\/a><\/p>\n<p>ESS 2008-2010 (rounds 4 and 5) in <a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2014\/05\/Oesch_class_schema_ESS2008_2010_ESS_Cumulative_Data_Wizard_Stata.txt\">Stata<\/a><\/p>\n<p>ESS 2012-2020 (rounds 6 to 10) in <a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2020\/11\/oesch_class_scheme_ESS_2012_2014_2016_2018.txt\">Stata<\/a><\/p>\n<p>ESS 2002-2010 (rounds 1 to 5) in\u00a0<strong><a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2020\/11\/R_oesch_class_scheme_ESS_2002_2004_2006_2008_2010.txt\">R<\/a><\/strong> or in <a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2014\/05\/Oesch_class_schema_ESS2002_2010_ESS_Cumulative_Data_Wizard_SPSS.txt\">SPSS<\/a><\/p>\n<p>ESS 2012-2023 (rounds 6 to 11) in <strong><a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2020\/11\/R_oesch_class_scheme_ESS_2012_2014_2016_2018.txt\">R<\/a><\/strong> or in <a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2020\/11\/SPSS_oesch_class_scheme_ESS_2012_2014_2016_2018.txt\">SPSS<\/a><\/p>\n<h6>International Social Survey Programme (ISSP) + MOSAiCH<\/h6>\n<p>ISSP 1987-2013 (+ cumulated dataset on Social Inequalities) in <a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2020\/11\/OeschClass_ISSP1997_ISSP2013_dataset_on_social_inequalities.txt\">Stata<\/a> with a <a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2020\/11\/ISSP_variable_names_1997_2013_plus_dataset_on_social_inequalities-1.pdf\">table<\/a> for variable names<\/p>\n<p>ISSP 2014-2017 in <a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2020\/11\/OeschClass_ISSP2014_2017.txt\">Stata<\/a><\/p>\n<p>ISSP 2010, 2011 in <a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2014\/05\/Oesch_class_schema_ISSP2010-2011.txt\">SPSS<\/a><\/p>\n<p>MOSAiCH-ISSP 2017 in <a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2019\/04\/Oesch_class_schema_MOSAiCH2017.txt\">Stata<\/a> (for Switzerland)<\/p>\n<p>MOSAiCH-ISSP 2019 in <a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2020\/11\/DoFile_OeschClass_Mosaich-2019_respondents_partners.txt\">Stata<\/a> (for Switzerland)<\/p>\n<p>MOSAiCH-ISSP 2022 in\u00a0<a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2023\/04\/Oesch_Class_Scheme_MOSAiCH2022.txt\"><strong>R<\/strong><\/a> (for Switzerland)<\/p>\n<h6>German Socio-Economic Panel (SOEP)<\/h6>\n<p>SOEP (CNEF equivalent file, all availables waves) in <a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2014\/05\/Oesch_class_schema_SOEPlong.do_.txt\">Stata<\/a><\/p>\n<h6>Swiss Household Panel (SHP)<\/h6>\n<p>SHP 1999 up to latest wave in <a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2014\/05\/Class_classification_Oesch_w1_SHP1999_stata.txt\">Stata<\/a><\/p>\n<p>SHP 1999 up to latest wave in <a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2014\/05\/Class_classification_Oesch_w1_SHP1999_spss.txt\">SPSS<\/a><\/p>\n<p>SHP 1999 up to latest wave in <a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2014\/05\/Class_classification_Oesch_w1_SHP1999_sas.txt\">SAS<\/a><\/p>\n<h6>Swiss Election Studies (SELECTS)<\/h6>\n<p>SELECTS 2019 in <a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2021\/01\/oesch_class_scheme_Selects_2019_Stata.txt\">Stata<\/a>, <a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2021\/01\/oesch_class_scheme_Selects_2019_R.txt\">R<\/a> or <a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2021\/01\/oesch_class_scheme_Selects_2019_SPSS.txt\">SPSS<\/a><\/p>\n<p>SELECTS 2015 in <a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2021\/01\/oesch_class_scheme_Selects_2015_Stata.txt\">Stata<\/a>, <a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2021\/01\/oesch_class_scheme_Selects_2015_R.txt\">R<\/a> or <a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2021\/01\/oesch_class_scheme_Selects_2015_SPSS.txt\">SPSS<\/a><\/p>\n<p>SELECTS 2011 in <a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2014\/05\/Class_ALL_Selects2011_SPSS.txt\">SPSS<\/a><\/p>\n<p>SELECTS 2007 in <a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2014\/05\/Class_ALL_Selects2007_SPSS.txt\">SPSS<\/a><\/p>\n<p>SELECTS 2003 in <a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2014\/05\/Class_ALL_Selects2003_SPSS.txt\">SPSS<\/a><\/p>\n<p>SELECTS 1999 in <a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2014\/05\/Class_ALL_Selects1999_SPSS.txt\">SPSS<\/a><\/p>\n<p>SELECTS 1995 in <a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2014\/05\/Class_ALL_Selects1995_SPSS.txt\">SPSS<\/a><\/p>\n\n\n<p><\/p>\n\n\n\n<p><strong>Luxembourg Income Study (LIS)<\/strong><\/p>\n\n\n\n<p>Using LIS data and variables for occupation, education and employment status, this  <strong><a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2023\/03\/Class-coding-scheme.pdf\">R-code<\/a> <\/strong>creates a 4-class variable for many countries and years, discussed in <a href=\"https:\/\/people.unil.ch\/danieloesch\/files\/2024\/08\/Moawad_Oesch_2024_Myth_of_Middle_Class_Squeeze.pdf\">Moawad &amp; Oesch (2025)<\/a>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Upper- and upper-middle class<\/li>\n\n\n\n<li>Middle class<\/li>\n\n\n\n<li>Skilled working class<\/li>\n\n\n\n<li>Low-skilled working class<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>For social class, you find below codes in Stata, R, SPSS and SAS for constructing my class scheme (discussed here in 2006 and 2023). To write your own code, refer to the Excel sheets below, which show how occupations are assigned to classes. For Stata, Ben Jann (University of Bern) has written the Stata module &hellip; <a href=\"https:\/\/people.unil.ch\/danieloesch\/scripts\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Scripts for Social Class &amp; OEP<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":84,"featured_media":0,"parent":0,"menu_order":6,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","footnotes":""},"class_list":["post-19","page","type-page","status-publish"],"_links":{"self":[{"href":"https:\/\/people.unil.ch\/danieloesch\/wp-json\/wp\/v2\/pages\/19","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/people.unil.ch\/danieloesch\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/people.unil.ch\/danieloesch\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/people.unil.ch\/danieloesch\/wp-json\/wp\/v2\/users\/84"}],"replies":[{"embeddable":true,"href":"https:\/\/people.unil.ch\/danieloesch\/wp-json\/wp\/v2\/comments?post=19"}],"version-history":[{"count":5,"href":"https:\/\/people.unil.ch\/danieloesch\/wp-json\/wp\/v2\/pages\/19\/revisions"}],"predecessor-version":[{"id":1037,"href":"https:\/\/people.unil.ch\/danieloesch\/wp-json\/wp\/v2\/pages\/19\/revisions\/1037"}],"wp:attachment":[{"href":"https:\/\/people.unil.ch\/danieloesch\/wp-json\/wp\/v2\/media?parent=19"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}