{"id":668,"date":"2007-02-12T13:37:28","date_gmt":"2007-02-12T11:37:28","guid":{"rendered":"http:\/\/www.wjst.de\/blog\/software\/nhanes-r-data-parser\/"},"modified":"2007-02-12T14:06:04","modified_gmt":"2007-02-12T12:06:04","slug":"nhanes-r-data-parser","status":"publish","type":"post","link":"https:\/\/www.wjst.de\/blog\/sciencesurf\/2007\/02\/nhanes-r-data-parser\/","title":{"rendered":"NHANES R data parser"},"content":{"rendered":"<p><a href=\"http:\/\/www.cdc.gov\/nchs\/about\/major\/nhanes\/nh3data.htm\">NHANES<\/a> is a great ressource for doing epidemiological research. As the NIH  website provides only data import for commercial software here is my rewrite in <a href=\"www.r-project.org\">R<\/a>. First load from their site<\/p>\n<p><a href=\"ftp:\/\/ftp.cdc.gov\/pub\/Health_Statistics\/NCHS\/Datasets\/NHANES\/NHANESIII\/1A\/adult.exe\">adult.exe<\/a><br \/>\n<a href=\"ftp:\/\/ftp.cdc.gov\/pub\/Health_Statistics\/NCHS\/Datasets\/NHANES\/NHANESIII\/1A\/youth.exe\">youth.exe<\/a><br \/>\n<a href=\"ftp:\/\/ftp.cdc.gov\/pub\/Health_Statistics\/NCHS\/Datasets\/NHANES\/NHANESIII\/1A\/lab.exe\">lab.exe<\/a><br \/>\n<a href=\"ftp:\/\/ftp.cdc.gov\/pub\/Health_Statistics\/NCHS\/Datasets\/NHANES\/NHANESIII\/1A\/lab2SE.exe\">lab2.exe<\/a><br \/>\n<a href=\"ftp:\/\/ftp.cdc.gov\/pub\/Health_Statistics\/NCHS\/Datasets\/NHANES\/NHANESIII\/1A\/exam.exe\">exam.exe<\/a><\/p>\n<p>put everything in one directory and expand the self-extracting archives. Then create from each SAS file a new variable content file that will only contain variable name and tab separated start position in the .dat file. Adult.var for example would read like this:<br \/>\n<code><br \/>\nSEQN\t1<br \/>\nDMPFSEQ\t6<br \/>\nDMPSTAT\t11<br \/>\nDMARETHN\t12<br \/>\nDMARACER\t13<br \/>\n...<br \/>\nHAZNOK5R\t3345<br \/>\n<\/code><\/p>\n<p>Then start the following R job with the datasets and variables that you are interested in<\/p>\n<p>|wj_nhanes.R|<\/p>\n\n<p>&nbsp;<\/p>\n<div class=\"bottom-note\">\n  <span class=\"mod1\">CC-BY-NC Science Surf , accessed 10.04.2026<\/span>\n <\/div>","protected":false},"excerpt":{"rendered":"<p>NHANES is a great ressource for doing epidemiological research. As the NIH website provides only data import for commercial software here is my rewrite in R. First load from their site adult.exe youth.exe lab.exe lab2.exe exam.exe put everything in one directory and expand the self-extracting archives. Then create from each SAS file a new variable &hellip; <a href=\"https:\/\/www.wjst.de\/blog\/sciencesurf\/2007\/02\/nhanes-r-data-parser\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">NHANES R data parser<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[1],"class_list":["post-668","post","type-post","status-publish","format-standard","hentry","category-genetics-biology","tag-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/posts\/668","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/comments?post=668"}],"version-history":[{"count":0,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/posts\/668\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/media?parent=668"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/categories?post=668"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wjst.de\/blog\/wp-json\/wp\/v2\/tags?post=668"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}