Collect information on ongoing education
Data on ongoing education (studies) exist with course as unit level (through unique course-identificator numbers). Courses are defined by the combination person x course type, and each individual can be represented by more than one course types simultaneously.
As data on ongoing education do not have person as unit level, such data can not be imported directly into an individual level dataset, but instead need to be merged through the commando
First, one must add/import a variable containing a link between course-ids and corresponding person-ids onto the course data (ongoing education). Next, one must aggregate the data to individual level through the commando
collapse. Finally, the data need to be merged into the main individual level dataset.
In the example below, an individual level dataset containing persons resident in Norway (regstatus == ‘1’) per 2010-01-01 is used as main dataset. Then ongoing education study streams over the period 2010-2012 is collected, where only higher level education (master or higher, education level 7 og 8) is kept. The commando
collapse (count) is used to count the number of observations/streams for ongoing education per individual over the period 2010-2012, and the result is finally merged into the main individual level dataset for further analysis.
Note: The values of the variable
kurstype (course type) will after the
collapse-transformation be replaced by numerical values refering to the statistical measure being used, in this case
count (number of observations/streams).
//Create individual level dataset containing residents in Norway per 2010-01-01 including the variable kjønn (gender) create-dataset persondata import BEFOLKNING_KJOENN as kjønn import BEFOLKNING_REGSTAT 2010-01-01 as regstatus keep if regstatus == '1' //Collect persons studying on higher education level in the period 2010-2012 create-dataset kursdata import-event NUDB_KURS_NUS 2010-01-01 to 2012-01-01 as kurstype destring kurstype, force keep if kurstype >= 700000 & kurstype < 999999 //Merge link between course-id and personal-id into course data create-dataset lenke_kurs_person import NUDB_KURS_FNR as fnr merge fnr into kursdata //Count number of observations/streams concerning higher educational studies per individual, and merge into main individual level dataset use kursdata collapse (count) kurstype, by(fnr) rename kurstype ant_kurs merge ant_kurs into persondata // Produce tabulation for higher level education studies (individual frequencies over 2010-2012 period) use persondata generate utdanning_høy = 0 replace utdanning_høy = 1 if ant_kurs >= 1 tabulate utdanning_høy kjønn