美国国家健康与营养调查( NHANES, National Health and Nutrition Examination Survey)是一项基于人群的横断面调查,旨在收集有关美国家庭人口健康和营养的信息。
地址为:https://wwwn.cdc.gov/nchs/nhanes/Default.aspx
既往再文章《Nhanes临床数据库挖掘教程1----数据库下载》中,咱们已经初步介绍了Nhanes临床数据的下载,但是这个数据没有涉及到死亡结局和随访时间,本次继续视频介绍如何下载死亡结局相关的数据。
死亡结局相关的数据地址如下:
https://www.cdc.gov/nchs/data-linkage/mortality.htm
手把手教你下载NHANES死亡数据
代码
r
library(readr)
library(dplyr)
#library(foreign)
setwd("E:/公众号文章2024年/nhanes死亡数据")
srvyin <- paste("NHANES_2007_2008_MORT_2019_PUBLIC.dat") # full .DAT name here
srvyout <- "NHANES_2007_2008" # shorthand dataset name here
dsn <- read_fwf(file=srvyin,
col_types = "iiiiiiii",
fwf_cols(seqn = c(1,6),
eligstat = c(15,15),
mortstat = c(16,16),
ucod_leading = c(17,19),
diabetes = c(20,20),
hyperten = c(21,21),
permth_int = c(43,45),
permth_exm = c(46,48)
),
na = c("", ".")
)
assign(paste0(srvyout), dsn)
#ELIGSTAT: Eligibility Status for Mortality Follow-up
table(dsn$eligstat)
#1 = "Eligible"
#2 = "Under age 18, not available for public release"
#3 = "Ineligible"
NHANES_2007_2008<-subset(NHANES_2007_2008,NHANES_2007_2008$eligstat == '1')
names(NHANES_2007_2008)<-toupper(names(NHANES_2007_2008))
#############
library(tidyverse)
library(haven)
library(nhanesA)
library(dplyr)
bc<-read.csv("E:/nhanes/nhanes.csv",sep=',',header=TRUE)
data<-join_all(list(NHANES_2007_2008, bc), by = 'SEQN', type = 'full')
data<-inner_join(NHANES_2007_2008,bc, by = 'SEQN')