clmi: Censored Likelihood Multiple Imputation

Description Usage Arguments Details Note References Examples

View source: R/clmi.R

Description

This function performs censored likelihood multiple imputation for single-pollutant models where the pollutant of interest is subject to varying detection limits across batches (this function will also work if there is only one distinct detection limit). The function outputs a list containing the imputed datasets and details regarding the imputation procedure (i.e., number of imputed dataset, covariates used to impute the non-detects, etc).

Usage

1
clmi(formula, df, lod, seed, n.imps = 5, verbose = FALSE)

Arguments

formula

A formula in the form of exposure ~ outcome + covariates. That is, the first variable on the right hand side of formula should be the outcome of interest.

df

A data.frame with exposure, outcome and covariates.

lod

Name of limit of detection variable in df.

seed

For reproducability.

n.imps

Number of datasets to impute. Default is 5.

verbose

If TRUE, clmi prints out useful debugging information while running. Default is FALSE.

Details

clmi is somewhat picky regarding the formula parameter. It tries to infer what transformation you'd like to apply to the exposure you are imputing, what the exposure is, and what the outcome is. It attempts to check to make sure that everything is working correctly, but it can fail. Roughly, the rules are:

Note

References

Boss J, Mukherjee B, Ferguson KK, et al. Estimating outcome-exposure associations when exposure biomarker detection limits vary across batches. Epidemiology. 2019;30(5):746-755. 10.1097/EDE.0000000000001052

Examples

1
2
3
4
5
6
7
8
library(lodi)

# Note that the outcome of interest is the first variable on the right hand
# side of the formula.
clmi.out <- clmi(poll ~ case_cntrl + smoking + gender, toy_data, lod, 1)

# you can specify a transformation to the exposure in the formula
clmi.out <- clmi(log(poll) ~ case_cntrl + smoking + gender, toy_data, lod, 1)

umich-cphds/lodi documentation built on Feb. 23, 2020, 9:43 a.m.