{"id":1281,"date":"2022-02-14T11:54:55","date_gmt":"2022-02-14T10:54:55","guid":{"rendered":"https:\/\/microdata.spirehost.no\/?post_type=eksempel&#038;p=1281"},"modified":"2023-08-18T13:31:04","modified_gmt":"2023-08-18T12:31:04","slug":"collect-information-on-ongoing-education-for-a-given-date","status":"publish","type":"eksempel","link":"https:\/\/www.microdata.no\/en\/eksempel\/collect-information-on-ongoing-education-for-a-given-date\/","title":{"rendered":"Collect information on ongoing education for a given date"},"content":{"rendered":"\n<p>Data on ongoing education (studies) exist with course as unit level (through unique course-identificator numbers). Courses are defined by the combination <em><strong>person x course type<\/strong><\/em>, and each individual can be represented by more than one course type simultaneously.<\/p>\n\n\n\n<p>As data on ongoing education do not have person as a unit level, such data can not be imported directly into an individual level dataset, but instead need to be merged through the command <code>merge<\/code>.<\/p>\n\n\n\n<p>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 command <code>collapse<\/code>. Finally, the data need to be merged into the main individual level dataset.<\/p>\n\n\n\n<p>In the example below, an individual level dataset containing persons resident in Norway (<code>regstatus == '1'<\/code>) per 2021-01-01 is used as the main dataset. Then ongoing education study events per 2021-11-01 are collected into a separate dataset. The command <code>collapse (count)<\/code> is used to count the number of observations\/events for ongoing education per individual on the specific date, and the result is finally merged into the main individual level dataset for further analysis.<\/p>\n\n\n\n<p>Note: The values of the variable coursetype will after the collapse-transformation be replaced by numerical values referring to the statistical measure being used, in this case <code>count<\/code> (number of observations\/events).<\/p>\n\n\n<div id=\"rose-block_c7e644c6a4a1b5a0ae5bb87109a7d9dd\" class=\"rose-code codeblock-wrapper\">\n<pre tabindex=\"0\" class=\"codeblock\"><code>\/\/Connect to datastore\r\nrequire no.ssb.fdb:23 as db\r\n\r\n\/\/Create individual level dataset containing residents in Norway per 2021-01-01 \r\ncreate-dataset persondata\r\nimport db\/BEFOLKNING_KJOENN as gender\r\nimport db\/BEFOLKNING_STATUSKODE 2021-01-01 as regstatus\r\nkeep if regstatus == '1'\r\n\r\n\/\/Retrieve people who are studying as of 1st November 2021, and connect this onto the personal data set. Since course data can have several observations per individual, the collapse command must be used to aggregate up to person level. We use count as aggregation value (number of records)\r\ncreate-dataset coursedata\r\nimport db\/NUDB_KURS_NUS 2021-11-01 as coursetype\r\nimport db\/NUDB_KURS_FNR as idnr\r\ncollapse (count) coursetype, by(idnr)\r\nrename coursetype courses\r\nmerge courses into persondata\r\n\r\n\/\/Produce tabulation for individuals who are studying as of 1st November 2021\r\nuse persondata\r\ngenerate student = 0\r\nreplace student = 1 if courses >= 1\r\ntabulate student gender<\/code><\/pre>\n<\/div>","protected":false},"parent":0,"menu_order":99,"template":"","meta":{"_acf_changed":false,"inline_featured_image":false,"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":""},"class_list":["post-1281","eksempel","type-eksempel","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Collect information on ongoing education for a given date - microdata.no<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.microdata.no\/eksempel\/hente-ut-informasjon-om-pagaende-utdanning-kurs-for-et-gitt-tidspunkt\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Collect information on ongoing education for a given date - microdata.no\" \/>\n<meta property=\"og:description\" content=\"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 type simultaneously. As data on ongoing education do not have person as a unit level, such data can not...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.microdata.no\/eksempel\/hente-ut-informasjon-om-pagaende-utdanning-kurs-for-et-gitt-tidspunkt\/\" \/>\n<meta property=\"og:site_name\" content=\"microdata.no\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-18T12:31:04+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.microdata.no\\\/eksempel\\\/hente-ut-informasjon-om-pagaende-utdanning-kurs-for-et-gitt-tidspunkt\\\/\",\"url\":\"https:\\\/\\\/www.microdata.no\\\/eksempel\\\/hente-ut-informasjon-om-pagaende-utdanning-kurs-for-et-gitt-tidspunkt\\\/\",\"name\":\"Collect information on ongoing education for a given date - microdata.no\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.microdata.no\\\/#website\"},\"datePublished\":\"2022-02-14T10:54:55+00:00\",\"dateModified\":\"2023-08-18T12:31:04+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.microdata.no\\\/eksempel\\\/hente-ut-informasjon-om-pagaende-utdanning-kurs-for-et-gitt-tidspunkt\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.microdata.no\\\/eksempel\\\/hente-ut-informasjon-om-pagaende-utdanning-kurs-for-et-gitt-tidspunkt\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.microdata.no\\\/eksempel\\\/hente-ut-informasjon-om-pagaende-utdanning-kurs-for-et-gitt-tidspunkt\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Hjem\",\"item\":\"https:\\\/\\\/www.microdata.no\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Collect information on ongoing education for a given date\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.microdata.no\\\/#website\",\"url\":\"https:\\\/\\\/www.microdata.no\\\/\",\"name\":\"microdata.no\",\"description\":\"Gj\u00f8r det enklere \u00e5 analysere registerdata\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.microdata.no\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Collect information on ongoing education for a given date - microdata.no","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.microdata.no\/eksempel\/hente-ut-informasjon-om-pagaende-utdanning-kurs-for-et-gitt-tidspunkt\/","og_locale":"en_US","og_type":"article","og_title":"Collect information on ongoing education for a given date - microdata.no","og_description":"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 type simultaneously. As data on ongoing education do not have person as a unit level, such data can not...","og_url":"https:\/\/www.microdata.no\/eksempel\/hente-ut-informasjon-om-pagaende-utdanning-kurs-for-et-gitt-tidspunkt\/","og_site_name":"microdata.no","article_modified_time":"2023-08-18T12:31:04+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.microdata.no\/eksempel\/hente-ut-informasjon-om-pagaende-utdanning-kurs-for-et-gitt-tidspunkt\/","url":"https:\/\/www.microdata.no\/eksempel\/hente-ut-informasjon-om-pagaende-utdanning-kurs-for-et-gitt-tidspunkt\/","name":"Collect information on ongoing education for a given date - microdata.no","isPartOf":{"@id":"https:\/\/www.microdata.no\/#website"},"datePublished":"2022-02-14T10:54:55+00:00","dateModified":"2023-08-18T12:31:04+00:00","breadcrumb":{"@id":"https:\/\/www.microdata.no\/eksempel\/hente-ut-informasjon-om-pagaende-utdanning-kurs-for-et-gitt-tidspunkt\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.microdata.no\/eksempel\/hente-ut-informasjon-om-pagaende-utdanning-kurs-for-et-gitt-tidspunkt\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.microdata.no\/eksempel\/hente-ut-informasjon-om-pagaende-utdanning-kurs-for-et-gitt-tidspunkt\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Hjem","item":"https:\/\/www.microdata.no\/en\/"},{"@type":"ListItem","position":2,"name":"Collect information on ongoing education for a given date"}]},{"@type":"WebSite","@id":"https:\/\/www.microdata.no\/#website","url":"https:\/\/www.microdata.no\/","name":"microdata.no","description":"Gj\u00f8r det enklere \u00e5 analysere registerdata","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.microdata.no\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"taxonomy_info":[],"featured_image_src_large":[],"author_info":[],"comment_info":"","_links":{"self":[{"href":"https:\/\/www.microdata.no\/en\/wp-json\/wp\/v2\/eksempel\/1281","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.microdata.no\/en\/wp-json\/wp\/v2\/eksempel"}],"about":[{"href":"https:\/\/www.microdata.no\/en\/wp-json\/wp\/v2\/types\/eksempel"}],"wp:attachment":[{"href":"https:\/\/www.microdata.no\/en\/wp-json\/wp\/v2\/media?parent=1281"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}