nhds_adult: Return adult, pediatric or just neonatal elements from the...

Description Usage Arguments Neonates and newborns Examples

Description

The age in the adult data is all specified in years, so the 'age_unit' column is dropped. The 'age_unit' field is retained when returning pediatric data.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
nhds_adult(nhds_data = nhds::nhds2010, rename_age = TRUE)

nhds_adults(nhds_data = nhds::nhds2010, rename_age = TRUE)

nhds_pediatric(nhds_data = nhds::nhds2010)

nhds_peds(nhds_data = nhds::nhds2010)

nhds_neonatal(nhds_data = nhds::nhds2010, rename_age = TRUE)

nhds_neonatal_not_newborn(nhds_data = nhds::nhds2010,
  rename_age = TRUE)

nhds_neonate_not_newborn(nhds_data = nhds::nhds2010, rename_age = TRUE)

nhds_neonate(nhds_data = nhds::nhds2010, rename_age = TRUE)

nhds_infant(nhds_data = nhds::nhds2010, rename_age = TRUE)

nhds_infant_not_neonate(nhds_data = nhds::nhds2010, rename_age = TRUE)

nhds_newborn(nhds_data = nhds::nhds2010)

nhds_newborns(nhds_data = nhds::nhds2010)

Arguments

nhds_data

The NHDS data, default is 'nhds2010', which is the only year currently provided by this package.

rename_age

Logical, if 'TRUE', the default, the 'age' field is renamed to either 'age_days' (for neonatal data) or 'age_years' (for adult data).

Neonates and newborns

For newborns, when the 'newborn' field is 'TRUE', the 'age' is always zero at time of admission, so 'age' and 'age_unit' are dropped. This must therefore refer to birth in hospital, not an admission of a neonate who is transferred. For the same reason, 'adm_type' is dropped because it is always 'newborn'.

In contrast, neonatal data includes both in-hospital births and admissions of patients with age 28 or fewer days. Strangely, 'marital_status' is populated with a variety of values for the neonatal data, but all 'newborn' babies are considered 'single', so that field is dropped by 'nhds_newborn'.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
head(nhds_adult())
# subset returned data directly
nhds_pediatric()[11:20, c("age_unit", "age")]
nhds_pediatric()[1:5, 1:7]
nhds_infant()[111:115, 1:7]
nhds_infant_not_neonate()[1:5, 1:7]
nhds_neonatal()[1:5, 1:7]
nhds_neonatal_not_newborn()[1:5, 1:7]
identical(nhds_neonatal()[1:10, ],
          nhds_neonate()[1:10, ])
identical(nhds_neonatal_not_newborn()[1:10, ],
          nhds_neonate_not_newborn()[1:10, ])
nhds_newborn()[1:5, 1:7]

nhds documentation built on May 1, 2019, 10:30 p.m.