{"id":3541,"date":"2023-07-18T15:28:27","date_gmt":"2023-07-18T14:28:27","guid":{"rendered":"https:\/\/www.microdata.no\/?post_type=eksempel&#038;p=3541"},"modified":"2023-10-27T16:39:20","modified_gmt":"2023-10-27T15:39:20","slug":"descriptive-statistics-sankey","status":"publish","type":"eksempel","link":"https:\/\/www.microdata.no\/en\/eksempel\/descriptive-statistics-sankey\/","title":{"rendered":"Descriptive statistics: sankey"},"content":{"rendered":"\n<p>The <code>sankey<\/code> command can be used on categorical variables to create transition diagrams for displaying movements between unit-level values. The most common is to create diagrams that show status changes measured over time, e.g. place of residence in 2016 vs. place of residence in 2021. Movements between statuses are represented by arrows that are wider the more units are in the transition in question.<\/p>\n\n\n\n<p>It is also possible to look at transitions between different types of states, e.g. jobseeker status in 2016 vs. employment status in 2021.<\/p>\n\n\n<div id=\"rose-block_916abc32d9e4dd9ed20ea4b734094886\" class=\"rose-code codeblock-wrapper\">\n<pre tabindex=\"0\" class=\"codeblock\"><code>\/\/ Transitions diagrams (Sankey)\r\n\r\nrequire no.ssb.fdb:23 as db\r\n\r\ncreate-dataset demographics\r\nimport db\/SIVSTANDFDT_SIVSTAND 2016-01-01 as maritalstate16\r\nimport db\/SIVSTANDFDT_SIVSTAND 2021-01-01 as maritalstate21\r\nimport db\/BOSATTEFDT_BOSTED 2016-01-01 as residence16\r\nimport db\/BOSATTEFDT_BOSTED 2021-01-01 as residence21\r\n\r\n\/\/ Recoding from municipality to county level \r\ngenerate county16 = substr(residence16,1,2)\r\ngenerate county21 = substr(residence21,1,2)\r\n\r\ndefine-labels countystring '01' '\u00d8stfold' '02' 'Akershus' '03' 'Oslo' '04' 'Hedmark' '05' 'Oppland' '06' 'Buskerud' '07' 'Vestfold' '08' 'Telemark' '09' 'Aust-Agder' '10' 'Vest-Agder' '11' 'Rogaland' '12' 'Hordaland' '14' 'Sogn and Fjordane' '15' 'M\u00f8re and Romsdal' '16' 'S\u00f8r-Tr\u00f8ndelag' '17' 'Nord-Tr\u00f8ndelag' '18' 'Nordland' '19' 'Troms' '20' 'Finnmark' '99' 'Unknown'\r\n\r\nassign-labels county16 countystring\r\nassign-labels county21 countystring\r\n\r\nsankey county16 county21 if county16 == '12'\r\nsankey county16 county21 if county21 == '03'\r\nsankey county16 county21 if county21 == '03' & county16 != '03'\r\n\r\nsankey maritalstate16 maritalstate21\r\nsankey maritalstate16 maritalstate21 if maritalstate16 == '2'<\/code><\/pre>\n<\/div>","protected":false},"parent":0,"menu_order":35,"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-3541","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>Descriptive statistics: sankey - 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\/deskriptiv-statistikk-sankey\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Descriptive statistics: sankey - microdata.no\" \/>\n<meta property=\"og:description\" content=\"The sankey command can be used on categorical variables to create transition diagrams for displaying movements between unit-level values. The most common is to create diagrams that show status changes measured over time, e.g. place of residence in 2016 vs. place of residence in 2021. Movements between statuses are represented by arrows that are wider...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.microdata.no\/eksempel\/deskriptiv-statistikk-sankey\/\" \/>\n<meta property=\"og:site_name\" content=\"microdata.no\" \/>\n<meta property=\"article:modified_time\" content=\"2023-10-27T15:39:20+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\\\/deskriptiv-statistikk-sankey\\\/\",\"url\":\"https:\\\/\\\/www.microdata.no\\\/eksempel\\\/deskriptiv-statistikk-sankey\\\/\",\"name\":\"Descriptive statistics: sankey - microdata.no\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.microdata.no\\\/#website\"},\"datePublished\":\"2023-07-18T14:28:27+00:00\",\"dateModified\":\"2023-10-27T15:39:20+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.microdata.no\\\/eksempel\\\/deskriptiv-statistikk-sankey\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.microdata.no\\\/eksempel\\\/deskriptiv-statistikk-sankey\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.microdata.no\\\/eksempel\\\/deskriptiv-statistikk-sankey\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Hjem\",\"item\":\"https:\\\/\\\/www.microdata.no\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Descriptive statistics: sankey\"}]},{\"@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":"Descriptive statistics: sankey - 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\/deskriptiv-statistikk-sankey\/","og_locale":"en_US","og_type":"article","og_title":"Descriptive statistics: sankey - microdata.no","og_description":"The sankey command can be used on categorical variables to create transition diagrams for displaying movements between unit-level values. The most common is to create diagrams that show status changes measured over time, e.g. place of residence in 2016 vs. place of residence in 2021. Movements between statuses are represented by arrows that are wider...","og_url":"https:\/\/www.microdata.no\/eksempel\/deskriptiv-statistikk-sankey\/","og_site_name":"microdata.no","article_modified_time":"2023-10-27T15:39:20+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\/deskriptiv-statistikk-sankey\/","url":"https:\/\/www.microdata.no\/eksempel\/deskriptiv-statistikk-sankey\/","name":"Descriptive statistics: sankey - microdata.no","isPartOf":{"@id":"https:\/\/www.microdata.no\/#website"},"datePublished":"2023-07-18T14:28:27+00:00","dateModified":"2023-10-27T15:39:20+00:00","breadcrumb":{"@id":"https:\/\/www.microdata.no\/eksempel\/deskriptiv-statistikk-sankey\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.microdata.no\/eksempel\/deskriptiv-statistikk-sankey\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.microdata.no\/eksempel\/deskriptiv-statistikk-sankey\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Hjem","item":"https:\/\/www.microdata.no\/en\/"},{"@type":"ListItem","position":2,"name":"Descriptive statistics: sankey"}]},{"@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\/3541","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=3541"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}