{"id":1277,"date":"2022-02-11T16:24:54","date_gmt":"2022-02-11T15:24:54","guid":{"rendered":"https:\/\/microdata.spirehost.no\/?post_type=eksempel&#038;p=1277"},"modified":"2023-08-18T13:31:03","modified_gmt":"2023-08-18T12:31:03","slug":"how-to-use-eventdata-to-find-persons-who-have-divorced-during-a-year","status":"publish","type":"eksempel","link":"https:\/\/www.microdata.no\/en\/eksempel\/how-to-use-eventdata-to-find-persons-who-have-divorced-during-a-year\/","title":{"rendered":"How to use eventdata to find persons who have divorced during a year"},"content":{"rendered":"\n<p>The example below demonstrates how to use the <code>import-event<\/code> command to create an event-dataset that can be used to find people who have divorced (records with sivil status = &#8216;4&#8217;) during a specific year.<\/p>\n\n\n\n<p>This procedure may also be used in all similar cases where the goal is to find persons with a spesific value measured over a time span.<\/p>\n\n\n<div id=\"rose-block_428d8712f8a6ef9d1674defb2fe633fa\" class=\"rose-code codeblock-wrapper\">\n<pre tabindex=\"0\" class=\"codeblock\"><code>\/\/Connect to datastore\r\nrequire no.ssb.fdb:23 as ds\r\n\r\n\/\/Create a population consisting of all residents in Norway per 2021-01-01\r\ncreate-dataset totalpop\r\nimport ds\/BEFOLKNING_KJOENN as gender\r\nimport ds\/BEFOLKNING_STATUSKODE 2021-01-01 as regstat\r\nkeep if regstat == '1'\r\n\r\n\/\/Find persons with divorce status during the previous year (2020)\r\ncreate-dataset events\r\nimport-event ds\/SIVSTANDFDT_SIVSTAND 2020-01-01 to 2020-12-31 as siv_events\r\nkeep if siv_events == '4'\r\ncollapse (count) siv_events, by(PERSONID_1 )\r\nrename siv_events divorces\r\ntabulate divorces\r\n\r\n\/\/Link divorce data onto the main residents dataset and creating a dummy variable indicating divorced status\r\nmerge divorces into totalpop\r\nuse totalpop\r\ngenerate divorced2020 = 0\r\nreplace divorced2020 = 1 if divorces >= 1\r\ntabulate divorced2020, cellpct\r\npiechart divorced2020<\/code><\/pre>\n<\/div>","protected":false},"parent":0,"menu_order":94,"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-1277","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>How to use eventdata to find persons who have divorced during a year - 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\/bruke-forlopsdata-til-a-finne-personer-som-har-skilt-seg-i-lopet-av-et-ar\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to use eventdata to find persons who have divorced during a year - microdata.no\" \/>\n<meta property=\"og:description\" content=\"The example below demonstrates how to use the import-event command to create an event-dataset that can be used to find people who have divorced (records with sivil status = &#8216;4&#8217;) during a specific year. This procedure may also be used in all similar cases where the goal is to find persons with a spesific value...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.microdata.no\/eksempel\/bruke-forlopsdata-til-a-finne-personer-som-har-skilt-seg-i-lopet-av-et-ar\/\" \/>\n<meta property=\"og:site_name\" content=\"microdata.no\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-18T12:31:03+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=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.microdata.no\\\/eksempel\\\/bruke-forlopsdata-til-a-finne-personer-som-har-skilt-seg-i-lopet-av-et-ar\\\/\",\"url\":\"https:\\\/\\\/www.microdata.no\\\/eksempel\\\/bruke-forlopsdata-til-a-finne-personer-som-har-skilt-seg-i-lopet-av-et-ar\\\/\",\"name\":\"How to use eventdata to find persons who have divorced during a year - microdata.no\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.microdata.no\\\/#website\"},\"datePublished\":\"2022-02-11T15:24:54+00:00\",\"dateModified\":\"2023-08-18T12:31:03+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.microdata.no\\\/eksempel\\\/bruke-forlopsdata-til-a-finne-personer-som-har-skilt-seg-i-lopet-av-et-ar\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.microdata.no\\\/eksempel\\\/bruke-forlopsdata-til-a-finne-personer-som-har-skilt-seg-i-lopet-av-et-ar\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.microdata.no\\\/eksempel\\\/bruke-forlopsdata-til-a-finne-personer-som-har-skilt-seg-i-lopet-av-et-ar\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Hjem\",\"item\":\"https:\\\/\\\/www.microdata.no\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to use eventdata to find persons who have divorced during a year\"}]},{\"@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":"How to use eventdata to find persons who have divorced during a year - 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\/bruke-forlopsdata-til-a-finne-personer-som-har-skilt-seg-i-lopet-av-et-ar\/","og_locale":"en_US","og_type":"article","og_title":"How to use eventdata to find persons who have divorced during a year - microdata.no","og_description":"The example below demonstrates how to use the import-event command to create an event-dataset that can be used to find people who have divorced (records with sivil status = &#8216;4&#8217;) during a specific year. This procedure may also be used in all similar cases where the goal is to find persons with a spesific value...","og_url":"https:\/\/www.microdata.no\/eksempel\/bruke-forlopsdata-til-a-finne-personer-som-har-skilt-seg-i-lopet-av-et-ar\/","og_site_name":"microdata.no","article_modified_time":"2023-08-18T12:31:03+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.microdata.no\/eksempel\/bruke-forlopsdata-til-a-finne-personer-som-har-skilt-seg-i-lopet-av-et-ar\/","url":"https:\/\/www.microdata.no\/eksempel\/bruke-forlopsdata-til-a-finne-personer-som-har-skilt-seg-i-lopet-av-et-ar\/","name":"How to use eventdata to find persons who have divorced during a year - microdata.no","isPartOf":{"@id":"https:\/\/www.microdata.no\/#website"},"datePublished":"2022-02-11T15:24:54+00:00","dateModified":"2023-08-18T12:31:03+00:00","breadcrumb":{"@id":"https:\/\/www.microdata.no\/eksempel\/bruke-forlopsdata-til-a-finne-personer-som-har-skilt-seg-i-lopet-av-et-ar\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.microdata.no\/eksempel\/bruke-forlopsdata-til-a-finne-personer-som-har-skilt-seg-i-lopet-av-et-ar\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.microdata.no\/eksempel\/bruke-forlopsdata-til-a-finne-personer-som-har-skilt-seg-i-lopet-av-et-ar\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Hjem","item":"https:\/\/www.microdata.no\/en\/"},{"@type":"ListItem","position":2,"name":"How to use eventdata to find persons who have divorced during a year"}]},{"@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\/1277","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=1277"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}