do.many.wqs {miWQS}R Documentation

Performing Many WQS Regressions

Description

Second Stage of Multiple Imputation: In order to analyze a complete imputed chemical array (X.imputed), _n_ subjects by _C_ chemicals by _K_ imputations) via weighted quantile sum regression, do.many.wqs() repeatedly performs the same WQS analysis on each imputed dataset. It repeatedly executes the estimate.wqs() function.

Usage

do.many.wqs(y, X.imputed, Z = NULL, ...)

Arguments

y

Outcome: numeric vector or factor. Assumed to be complete, and missing outcomes are ignored. Assumed to follow an exponential family distribution given in family.

X.imputed

Array of complete components with n subjects and C components and K imputations. Must be complete.

Z

Any covariates used. Ideally, a numeric matrix, but Z can be a factor, vector or data-frame. Assumed to be complete; observations with missing covariate values are ignored with a warning printed. If none, enter NULL.

...

Additional arguments passed to estimate.wqs, but the arguments y, X, Z, and place.bdls.Q1 have no effect.

Value

Returns a list with elements that consist of matrix and list versions of estimate.wqs() output:

Note

Note #1: We only impute the missing values of the components, X. Any missing data in the outcome and covariates are removed and ignored.

Note #2: No seed is set in this function. Because bootstraps and splitting is random, a seed should be set before every use.

Note #3: If there is one imputed dataset, use the estimate.wqs function as do.many.wqs is not necessary.

See Also

Other wqs: analyze.individually(), coef.wqs(), estimate.wqs.formula(), estimate.wqs(), make.quantile.matrix(), plot.wqs(), print.wqs()

Examples

data("simdata87")
# Create 2 multiple imputed datasets using bootstrapping, but only use first 2 chemicals.
set.seed(23234)
l <- impute.boot(
  X = simdata87$X.bdl[, 1:2], DL = simdata87$DL[1:2],
  Z = simdata87$Z.sim[, 1], K = 2
)
# Perform WQS regression on each imputed dataset
set.seed(50679)
bayes.wqs <- do.many.wqs(
  y = simdata87$y.scenario, X.imputed = l$X.imputed,
  Z = simdata87$Z.sim,
  B = 10, family = "binomial"
)
bayes.wqs$wqs.imputed.estimates



# #' @importFrom scales ordinal

[Package miWQS version 0.4.4 Index]