knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures"
)
library(ers)

R package ers

r badger::badge_devel("umich-biostatistics/ers", "blue") r badger::badge_code_size("umich-biostatistics/ers")

Overview

Estimate environmental risk scores from a number of potentially correlated risk factors using adaptive elastic net (AENET) regression. ENET regression does variable selection and can select multiple non-zero collinear variables without overfitting. AENET is an adaptive version of elastic net (ENET) that satisfies the asymptotic normality assumption that allows us to conduct statistical inference any hypothesis testing by providing large sample standard errors and p-values. Adaptive weights shink smaller coefficients to zero, whereas larger coefficients are penalized less. The technical details of the model implemented here are described in "Associations of cumulative exposure to heavy metal mixtures with obesity and its comorbidities among U.S. adults in NHANES 2003–2014" (2018) In press at Environment International .

Installation

You should have R at least version 3.5.0 installed before trying to install this package.

If the devtools package is not yet installed, install it first:

install.packages('devtools')

Then run:

# install AEenrich from Github:
devtools::install_github('umich-biostatistics/ers') 
library(ers)

Example usage

For documentation pages:

?ers

Quick example:

names(metal)
head(metal)
names(Y)
head(Y)
names(covs)
head(covs)
set.seed(7794)
fit = ers(x = metal, y = as.numeric(Y), covar = covs,
          control = list(lambda2.start = seq(0.001, 0.5, by = 0.01),
                         lambda2.adapt = seq(0.001, 0.5, by = 0.01)))

Current Suggested Citation

Wang, Xin, Bhramar Mukherjee, and Sung Kyun Park. "Associations of cumulative exposure to heavy metal mixtures with obesity and its comorbidities among US adults in NHANES 2003–2014." Environment international 121 (2018): 683-694. doi:10.1016/j.envint.2018.09.035.



umich-biostatistics/ers documentation built on Oct. 29, 2020, 8:15 a.m.