{"id":3539,"date":"2023-07-18T15:14:34","date_gmt":"2023-07-18T14:14:34","guid":{"rendered":"https:\/\/www.microdata.no\/?post_type=eksempel&#038;p=3539"},"modified":"2023-10-27T16:39:20","modified_gmt":"2023-10-27T15:39:20","slug":"descriptive-statistics-piechart-and-hexbin","status":"publish","type":"eksempel","link":"https:\/\/www.microdata.no\/en\/eksempel\/descriptive-statistics-piechart-and-hexbin\/","title":{"rendered":"Descriptive statistics: piechart and hexbin"},"content":{"rendered":"\n<p>The <code>piechart<\/code> command is used to create pie charts for discrete variables. The <code>hexbin<\/code> command creates an anonymizing plot diagram where the plot area is divided into hexagons which are colored based on how many plots there are in each area.<\/p>\n\n\n<div id=\"rose-block_713c52430384a1489d7ba7c7aac5c75c\" class=\"rose-code codeblock-wrapper\">\n<pre tabindex=\"0\" class=\"codeblock\"><code>require no.ssb.fdb:23 as db\r\n\r\ncreate-dataset demografidata\r\nimport db\/INNTEKT_WYRKINNT 2020-01-01 as innt\r\nimport db\/INNTEKT_BRUTTOFORM 2020-01-01 as formue\r\nimport db\/BEFOLKNING_KJOENN as kj\u00f8nn\r\nimport db\/BEFOLKNING_FOEDSELS_AAR_MND as faarmnd\r\nimport db\/BOSATTEFDT_BOSTED 2020-01-01 as bosted\r\n\r\n\/\/ Koder om fra kommune- til fylkesniv\u00e5 \r\ngenerate fylke = substr(bosted,1,2)\r\n\r\ndefine-labels fylkerstring '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 og Fjordane' '15' 'M\u00f8re og Romsdal' '16' 'S\u00f8r-Tr\u00f8ndelag' '17' 'Nord-Tr\u00f8ndelag' '18' 'Nordland' '19' 'Troms' '20' 'Finnmark' '99' 'Uoppgitt'\r\nassign-labels fylke fylkerstring\r\n\r\n\/\/ Genererer alder per 2020\r\ngenerate alder = 2020 - int(faarmnd\/100)\r\n\r\n\/\/ Kakediagram\r\n\/\/ Dette er en fin m\u00e5te \u00e5 vise den prosentvise fordelingen for diskrete variabler p\u00e5 en grafisk m\u00e5te\r\n\r\ndrop if alder < 16\r\n\r\npiechart kj\u00f8nn\r\npiechart fylke\r\n\r\n\/\/ Hexbinplot\r\n\/\/ Dette er en anonymiserende m\u00e5te \u00e5 fremstille plotdiagrammer (egner seg best for kontinuerlige\/metriske variabler), der tettheten i plottene fargelegges p\u00e5 en systematisk m\u00e5te for \u00e5 avdekke m\u00f8nstre i fordelingen mellom to variabler\r\n\r\nhexbin formue innt\r\nhexbin formue innt if alder > 50<\/code><\/pre>\n<\/div>","protected":false},"parent":0,"menu_order":33,"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-3539","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: piechart and hexbin - 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-piechart-og-hexbin\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Descriptive statistics: piechart and hexbin - microdata.no\" \/>\n<meta property=\"og:description\" content=\"The piechart command is used to create pie charts for discrete variables. The hexbin command creates an anonymizing plot diagram where the plot area is divided into hexagons which are colored based on how many plots there are in each area.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.microdata.no\/eksempel\/deskriptiv-statistikk-piechart-og-hexbin\/\" \/>\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-piechart-og-hexbin\\\/\",\"url\":\"https:\\\/\\\/www.microdata.no\\\/eksempel\\\/deskriptiv-statistikk-piechart-og-hexbin\\\/\",\"name\":\"Descriptive statistics: piechart and hexbin - microdata.no\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.microdata.no\\\/#website\"},\"datePublished\":\"2023-07-18T14:14:34+00:00\",\"dateModified\":\"2023-10-27T15:39:20+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.microdata.no\\\/eksempel\\\/deskriptiv-statistikk-piechart-og-hexbin\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.microdata.no\\\/eksempel\\\/deskriptiv-statistikk-piechart-og-hexbin\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.microdata.no\\\/eksempel\\\/deskriptiv-statistikk-piechart-og-hexbin\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Hjem\",\"item\":\"https:\\\/\\\/www.microdata.no\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Descriptive statistics: piechart and hexbin\"}]},{\"@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: piechart and hexbin - 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-piechart-og-hexbin\/","og_locale":"en_US","og_type":"article","og_title":"Descriptive statistics: piechart and hexbin - microdata.no","og_description":"The piechart command is used to create pie charts for discrete variables. The hexbin command creates an anonymizing plot diagram where the plot area is divided into hexagons which are colored based on how many plots there are in each area.","og_url":"https:\/\/www.microdata.no\/eksempel\/deskriptiv-statistikk-piechart-og-hexbin\/","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-piechart-og-hexbin\/","url":"https:\/\/www.microdata.no\/eksempel\/deskriptiv-statistikk-piechart-og-hexbin\/","name":"Descriptive statistics: piechart and hexbin - microdata.no","isPartOf":{"@id":"https:\/\/www.microdata.no\/#website"},"datePublished":"2023-07-18T14:14:34+00:00","dateModified":"2023-10-27T15:39:20+00:00","breadcrumb":{"@id":"https:\/\/www.microdata.no\/eksempel\/deskriptiv-statistikk-piechart-og-hexbin\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.microdata.no\/eksempel\/deskriptiv-statistikk-piechart-og-hexbin\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.microdata.no\/eksempel\/deskriptiv-statistikk-piechart-og-hexbin\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Hjem","item":"https:\/\/www.microdata.no\/en\/"},{"@type":"ListItem","position":2,"name":"Descriptive statistics: piechart and hexbin"}]},{"@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\/3539","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=3539"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}