chemlm: chemlm

View source: R/chemlm.R

chemlmR Documentation

chemlm

Description

Regression models for multiple chemical exposures

Usage

chemlm(x, ...)

## Default S3 method:
chemlm(
  data,
  outcome,
  chem,
  value = "value",
  adjust = NULL,
  confound = NULL,
  family = "gaussian",
  type = "filter",
  mixed = F,
  id = NULL,
  weights = NULL,
  resid = F,
  corstr1 = "independence"
)

## S3 method for class 'chemlm'
print(x)

## S3 method for class 'chemlm'
plot(x, scales = "free", ncol = 3, facetchem = F, facetout = F)

## S3 method for class 'chemlm'
plot(x, scales = "free", ncol = 3, facetchem = F, facetout = F)

Arguments

data

dataset. data should be in "long" format with the chemical names in one column and the values in another

outcome

character outcome variable

chem

column name for chemical type (string format)

value

column name for value (string format)

adjust

function to modify chemicals (default is NULL)

confound

character vector of confound variables

family

regression family (default is linear model)

type

whether to filter results for only chem

mixed

whether mixed model (random intercept only currently)

id

id variable name

weights

weights variable name

resid

whether to output residuals

Details

chemlm Run regression model for chemical data

This is a function to run multiple regression models for chemical data, where each model is fitted to a single chemical at a time

Examples

data(simchemdat)
res <- chemlm(simchemdat, outcome = "out", chem = "chem")
print(res)
plot(res)

kralljr/chemregr documentation built on Nov. 28, 2022, 3:01 p.m.