Skip to content

Latest commit

 

History

History
68 lines (55 loc) · 2.19 KB

README.md

File metadata and controls

68 lines (55 loc) · 2.19 KB

nhds

CRAN status Travis build status AppVeyor build status Lifecycle: stable

The National Hospital Discharge Survey (2010) summarizes the state of patients at the end of their hospital admissions. The US CDC publishes the data in the public domain, and describes it as follows: The National Hospital Discharge Survey (NHDS) is a continuing nationwide sample survey of short-stay hospitals in the United States. The scope of NHDS encompasses patients discharged from noninstitutional hospitals, exclusive of military and Department of Veterans Affairs hospitals, located in the 50 States and the District of Columbia. Only hospitals having six or more beds for in-patient use are included in the survey. See https://www.cdc.gov/nchs/nhds for more information.

See documentation for the R CRAN package: icd for how to use this data. See also the R CRAN package: icd.data.

Examples

nhds2010$hypertension <- icd::comorbid_ahrq(nhds2010)[, "HTN"]
nhds2010$charlson <- icd::charlson(nhds2010)
hist(nhds2010[nhds2010$age_unit == "years", "age"],
     main = "Histogram of age when specified in years", 
     xlab = "Age in years"
     )

boxplot(age ~ hypertension, 
        data = nhds2010,
        outline = FALSE,
        ylab = "Age")

boxplot(charlson ~ adm_type, 
        data = nhds2010,
        las = 2, 
        varwidth = TRUE, 
        outline = FALSE,
        ylab = "Charlson Score"
        )