Working with harmonized Variables¶
This exercise shows you how to work effectively with versioned and harmonized SOEP variables. Please note that the new SOEP versioning and harmonizing concept has only been available since SOEP-Core v34 and only applies to the original SOEP-Core data in long format.
Create an exercise path with four subfolders:
These are used to store your script, log files, datasets, and temporary datasets. Open an empty do-file and define your paths with globals:
1 2 3 4 5 6 7 8 9
*********************************************** * Set relative paths to the working directory *********************************************** global AVZ "H:\material\exercises" global MY_IN_PATH "\\hume\rdc-gen\consolidated\soep-long\soep.v34" global MY_DO_FILES "$AVZ\do\" global MY_LOG_OUT "$AVZ\log\" global MY_OUT_DATA "$AVZ\output\" global MY_OUT_TEMP "$AVZ\temp\"
The global “AVZ” defines the main path. The main paths are subdivided using the globals “MY_IN_PATH”, “MY_DO_FILES”, “MY_LOG_OUT”, “MY_OUT_DATA”, “MY_OUT_TEMP”. The global “MY_IN_PATH” contains the path to your ordered data.
1.) Differences in Response Options
Variables are versioned and harmonized because the response options have changed over time.
The variable plb0038_v1 was obtained from a simple yes/no question between 1992 and 2004. Since 2005, new response options have been added. The individual questionnaires from 2004 and 2005 show these differences. Through the versioning of the variable plb0038, this difference is recognizable to the data user when tabulating the variable. The variable label also shows the beginning and end of the period in which the question was asked differently.
1 2 3
use "$MY_IN_PATH\pl.dta" tab plb0038_v1 tab plb0038_v2
The variable plb0038_v1 is recoded during the harmonization process and written into a new variable, plb0038_h, together with plb0038_v2. The harmonized version of the variable should cover the survey period from 1992 to 2014 and should be usable.
tab plb0038_h tabstat plb0038_v1 plb0038_v2 plb0038_h, by(syear)
2.) Differences in Coding of Response Options
Variables are versioned and harmonized because the coding of the response options has changed over time. Since the values of certain response options can change, the various wave-specific variables cannot be integrated easily into a variable in long format. The variable must be appropriately harmonized to be useable.
From 1994 to 2004, the question about occupational change was asked in the individual questionnaire as a category question with six response options. The order of the response options changed in 2005.
tab plb0284_v1 tab plb0284_v2
In addition to the different order of the response options, the coding order also changed. The data are stored in the wave-specific “raw” datasets with different coding and are contained in the variables plb0284_v1 and plb0284_v2. To use the variable for all survey years, it is necessary to harmonize the different versions. The variable plb0284_v1 is recoded (recode (1=1)(2=2)(3=3)(4=6)(5=4)(6=5)) and then written together with plb0284_v2 as plb0284_h. The new variable plb0284_h is created by the harmonization process.
tab plb0284_h tabstat plb0284_v1 plb0284_v2 plb0284_h, by(syear)
3.) Content Differences in the Questions.
Variables are versioned when questions were asked differently in different years but the content belongs together. If the content or wording of the question changes, the wave-specific variables cannot easily be integrated into a long variable.
In the 2001 individual questionnaire, respondents were asked whether they had ever received an inheritance. In 2017, this question was worded differently: respondents were asked whether they had received an inheritance in the last 15 years. The questions are similar but cover different time periods. Therefore, the variable is not harmonized but made available as versioned variables. Data users have to decide whether or not to use the variables in the same way.
tab plc0375_v1 tab plc0375_v2
4.) Change of Question Type.
Variables are versioned and harmonized when questions were asked differently in different years, for example, first as a question with multiple response options and later as a question with a single response option. A possible multiple answer in certain years makes it difficult to integrate the wave-specific variables into a variable in long format.
When comparing the question on scholarships in the individual questionnaires from 2011 and 2012, it appears that there should be no differences in the variables. Nevertheless, the two questions seem to have been asked differently and stored differently in the raw datasets. This results in several versioned variables.
1 2 3 4
tab plg0015_v1 tab plg0015_v2 tab plg0015_v3 tab plg0015_v4
As you can see, the variable was asked from 2007 to 2011 as a category question with three response options. As a result, respondents could only give one answer. Since 2012, the question has used binary items. It is quite possible that a respondent gave more than one answer. The harmonized version of the variable integrates the binary items from plg0015_v2, plg0015_v3, and plg0015_v4 into the harmonized version plg0015_h. The coding of the variable plg0015_v1 is used as the generation framework. In addition, the harmonization proposal takes into account the problematic multiple answers with the value four.
plg0015_h tabstat plg0015_v1 plg0015_v2 plg0015_v3 plg0015_v4 plg0015_h, by(syear)
5.) Euro harmonisation
Variables are versioned and harmonized because they are metric and were asked as DM amounts before the introduction of the euro. For the long version of the variable, metric variables based on different currencies in different years are harmonized as euro amounts.
Most of the variables harmonized in the long datasets are amounts of money. Before the introduction of the euro, such information was collected in DM.
Euro harmonisation involves DM amounts being multiplied by the exchange rate so that the harmonized version of the variable represents euro amounts.
list pid syear plc0013_v1 plc0013_h if pid==7006001 & syear==2001 tabstat plc0013_v1 plc0013_v2 plc0013_h, by(syear)