NHANES数据检索工具说明书

Package‘nhanesA’
July16,2023
Version0.7.4
Date2023-07-16
Title NHANES Data Retrieval
BugReports github/cjendres1/nhanes/issues
Depends R(>=3.0.0)
Imports stringr,foreign,rvest,magrittr,xml2,plyr
Description Utility to retrieve data from the National Health and Nutrition
Examination Survey(NHANES)website<v/nchs/nhanes/index.htm>. License GPL(>=2)
Encoding UTF-8
URL /package=nhanesA
Suggests knitr,rmarkdown
VignetteBuilder knitr
RoxygenNote7.2.3
NeedsCompilation no
Author Christopher Endres[aut,cre]
Maintainer Christopher Endres<*******************>
Repository CRAN
Date/Publication2023-07-1616:00:03UTC
R topics documented:
browseNHANES (2)
nhanes (3)
nhanesAttr (3)
nhanesCodebook (4)
nhanesDXA (5)
nhanesSearch (6)
nhanesSearchTableNames (7)
1
2browseNHANES nhanesSearchVarName (8)
nhanesTables (9)
nhanesTableVars (10)
nhanesTranslate (11)
Index13 browseNHANES Open a browser to NHANES.
Description
The browser may be directed to a specific year,survey,or table.
Usage
browseNHANES(year=NULL,data_group=NULL,nh_table=NULL)
Arguments
year The year in yyyy format where1999<=yyyy.
data_group The type of survey(DEMOGRAPHICS,DIETARY,EXAMINATION,LABO-RATORY,QUESTIONNAIRE).Abbreviated terms may also be used:(DEMO,
DIET,EXAM,LAB,Q).
nh_table The name of an NHANES table.
Details
browseNHANES will open a web browser to the specified NHANES site.
Value
No return value
Examples
browseNHANES()#Defaults to the main data sets page
browseNHANES(2005)#The main page for the specified survey year
browseNHANES(2009, EXAM )#Page for the specified year and survey group
browseNHANES(nh_table= VIX_D )#Page for a specific table
browseNHANES(nh_table= DXA )#DXA main page
nhanes3 nhanes Download an NHANES table and return as a data frame.
Description
Use to download NHANES data tables that are in SAS format.
Usage
nhanes(nh_table,includelabels=FALSE)
Arguments
nh_table The name of the specific table to retrieve.
includelabels If TRUE,then include SAS labels as variable attribute(default=FALSE). Details
Downloads a table from the NHANES website as in its entirety with no modification or cleansing.NHANES tables are stored in SAS’.XPT’format but are imported as a data frame.
Function nhanes cannot be used to import limited access data.
Value
The table is returned as a data frame.
Examples
nhanes( BPX_E )
nhanes( FOLATE_F ,includelabels=TRUE)
nhanesAttr Returns the attributes of an NHANES data table.
Description
Returns attributes such as number of rows,columns,and memory size,but does not return the table itself.
Usage
nhanesAttr(nh_table)
Arguments
nh_table The name of the specific table to retrieve
4nhanesCodebook
Details
nhanesAttr allows one to check the size and other charactersistics of a data table before import-ing into R.To retrieve these characteristics,the specified table is downloaded,characteristics are determined,then the table is deleted.
Value
The following attributes are returned as a list
nrow=number of rows
ncol=number of columns
names=name of each column
unique=true if all SEQN values are unique
na=number of’NA’cells in the table
size=total size of table in bytes
types=data types of each column
Examples
nhanesAttr( BPX_E )
nhanesAttr( FOLATE_F )
nhanesCodebook Display codebook for selected variable.
Description
Returns full NHANES codebook including Variable Name,SAS Label,English Text,Target,and Value distribution.
Usage
nhanesCodebook(nh_table,colname,dxa=FALSE)
Arguments
nh_table The name of the NHANES table that contains the desired variable.
colname The name of the table column(variable).
dxa If TRUE then the2005-2006DXA codebook will be used(default=FALSE).
Details
Each NHANES variable has a codebook that provides a basic description as well as the distribution or range of values.This function returns the full codebook information for the selected variable.
Value
The codebook is returned as a list object.Returns NULL upon error.
nhanesDXA5 Examples
nhanesCodebook( AUX_D , AUQ020D )
nhanesCodebook( BPX_J , BPACSZ )
nhanesDXA Import Dual Energy X-ray Absorptiometry(DXA)data.
Description
DXA data were acquired from1999-2006.
Usage
nhanesDXA(year,suppl=FALSE,destfile=NULL)
Arguments
year The year of the data to import,where1999<=year<=2006.
suppl If TRUE then retrieve the supplemental data(default=FALSE).
destfile The name of a destinationfile.If NULL then the data are imported into the R environment but nofile is created.
Details
Provide destfile in order to write the data tofile.If destfile is not provided then the data will be imported into the R environment.
Value
By default the table is returned as a data frame.When downloading tofile,the return argument is the int
eger code from download.file where0means success and non-zero indicates failure to download.
Examples
dxa_b<-nhanesDXA(2001)
dxa_c_s<-nhanesDXA(2003,suppl=TRUE)
##Not run:nhanesDXA(1999,destfile="dxx.xpt")

本文发布于:2024-09-23 08:19:39,感谢您对本站的认可!

本文链接:https://www.17tex.com/tex/3/472877.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2024 Comsenz Inc.Powered by © 易纺专利技术学习网 豫ICP备2022007602号 豫公网安备41160202000603 站长QQ:729038198 关于我们 投诉建议