{"id":1306,"date":"2022-02-14T16:15:42","date_gmt":"2022-02-14T15:15:42","guid":{"rendered":"https:\/\/microdata.spirehost.no\/?post_type=eksempel&#038;p=1306"},"modified":"2023-08-18T13:31:05","modified_gmt":"2023-08-18T12:31:05","slug":"how-to-use-parental-information-in-analysis","status":"publish","type":"eksempel","link":"https:\/\/www.microdata.no\/en\/eksempel\/how-to-use-parental-information-in-analysis\/","title":{"rendered":"How to use parental information in analysis"},"content":{"rendered":"\n<p>The database contains variables for father\u2019s and mother\u2019s birth identification number respectively, which makes it possible to link parental information with an individual based dataset.<\/p>\n\n\n\n<p>The command <code>merge<\/code> makes it possible to link datasets. The key unit identification variable of the target dataset is used by default, unless customised through an <code>on<\/code> option.<\/p>\n\n\n\n<p>In this example, a separate dataset is made for fathers and mothers, which are linked to a personal level dataset via the key-link variables <em>idnr_father<\/em> and <em>idnr_mother<\/em>.<\/p>\n\n\n<div id=\"rose-block_e3b794e493fe0a8969c324689a3b93e0\" 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 a main dataset with links to fathers and mothers\r\ncreate-dataset persondata\r\nimport db\/INNTEKT_WYRKINNT 2021-01-01 as workincome\r\nimport db\/BEFOLKNING_KJOENN as gender\r\nimport db\/NUDB_BU 2021-01-01 as edu\r\nimport db\/BEFOLKNING_FAR_FNR as idnr_father\r\nimport db\/BEFOLKNING_MOR_FNR as idnr_mother\r\n\r\n\/\/Import data on parents and merge into main dataset\r\ncreate-dataset parents\r\nimport db\/INNTEKT_WYRKINNT 2021-01-01 as workincome_father\r\nimport db\/NUDB_BU 2021-01-01 as edu_father\r\nclone-variables workincome_father -> workincome_mother\r\nclone-variables edu_father -> edu_mother\r\nmerge workincome_father edu_father into persondata on idnr_father\r\nmerge workincome_mother edu_mother into persondata on idnr_mother\r\n\r\n\/\/Perform basic linear regression analysis to test for covariation with parental income\r\nuse persondata\r\ngenerate male = 0\r\nreplace male = 1 if gender == '1'\r\n\r\ndestring edu\r\ngenerate high_edu = 0\r\nreplace high_edu = 1 if edu >= 700000 & edu < 900000\r\nreplace high_edu = edu if sysmiss(edu)\r\n\r\ndestring edu_father\r\ngenerate high_edu_father = 0\r\nreplace high_edu_father = 1 if edu_father >= 700000 & edu_father < 900000\r\nreplace high_edu_father = edu_father if sysmiss(edu_father)\r\n\r\ndestring edu_mother\r\ngenerate high_edu_mother = 0\r\nreplace high_edu_mother = 1 if edu_mother >= 700000 & edu_mother < 900000\r\nreplace high_edu_mother = edu_mother if sysmiss(edu_mother)\r\n\r\nsummarize workincome workincome_father workincome_mother\r\nhistogram workincome_father, percent\r\nhistogram workincome_mother, percent\r\ncorrelate workincome_father workincome_mother\r\ntabulate high_edu_father high_edu_mother\r\n\r\nregress workincome male workincome_father workincome_mother high_edu high_edu_father high_edu_mother<\/code><\/pre>\n<\/div>","protected":false},"parent":0,"menu_order":105,"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-1306","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 parental information in analysis - 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\/hvordan-benytte-foreldreopplysninger-i-analyser\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to use parental information in analysis - microdata.no\" \/>\n<meta property=\"og:description\" content=\"The database contains variables for father\u2019s and mother\u2019s birth identification number respectively, which makes it possible to link parental information with an individual based dataset. The command merge makes it possible to link datasets. The key unit identification variable of the target dataset is used by default, unless customised through an on option. In this...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.microdata.no\/eksempel\/hvordan-benytte-foreldreopplysninger-i-analyser\/\" \/>\n<meta property=\"og:site_name\" content=\"microdata.no\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-18T12:31:05+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\\\/hvordan-benytte-foreldreopplysninger-i-analyser\\\/\",\"url\":\"https:\\\/\\\/www.microdata.no\\\/eksempel\\\/hvordan-benytte-foreldreopplysninger-i-analyser\\\/\",\"name\":\"How to use parental information in analysis - microdata.no\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.microdata.no\\\/#website\"},\"datePublished\":\"2022-02-14T15:15:42+00:00\",\"dateModified\":\"2023-08-18T12:31:05+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.microdata.no\\\/eksempel\\\/hvordan-benytte-foreldreopplysninger-i-analyser\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.microdata.no\\\/eksempel\\\/hvordan-benytte-foreldreopplysninger-i-analyser\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.microdata.no\\\/eksempel\\\/hvordan-benytte-foreldreopplysninger-i-analyser\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Hjem\",\"item\":\"https:\\\/\\\/www.microdata.no\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to use parental information in analysis\"}]},{\"@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 parental information in analysis - 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\/hvordan-benytte-foreldreopplysninger-i-analyser\/","og_locale":"en_US","og_type":"article","og_title":"How to use parental information in analysis - microdata.no","og_description":"The database contains variables for father\u2019s and mother\u2019s birth identification number respectively, which makes it possible to link parental information with an individual based dataset. The command merge makes it possible to link datasets. The key unit identification variable of the target dataset is used by default, unless customised through an on option. In this...","og_url":"https:\/\/www.microdata.no\/eksempel\/hvordan-benytte-foreldreopplysninger-i-analyser\/","og_site_name":"microdata.no","article_modified_time":"2023-08-18T12:31:05+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\/hvordan-benytte-foreldreopplysninger-i-analyser\/","url":"https:\/\/www.microdata.no\/eksempel\/hvordan-benytte-foreldreopplysninger-i-analyser\/","name":"How to use parental information in analysis - microdata.no","isPartOf":{"@id":"https:\/\/www.microdata.no\/#website"},"datePublished":"2022-02-14T15:15:42+00:00","dateModified":"2023-08-18T12:31:05+00:00","breadcrumb":{"@id":"https:\/\/www.microdata.no\/eksempel\/hvordan-benytte-foreldreopplysninger-i-analyser\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.microdata.no\/eksempel\/hvordan-benytte-foreldreopplysninger-i-analyser\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.microdata.no\/eksempel\/hvordan-benytte-foreldreopplysninger-i-analyser\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Hjem","item":"https:\/\/www.microdata.no\/en\/"},{"@type":"ListItem","position":2,"name":"How to use parental information in analysis"}]},{"@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\/1306","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=1306"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}